Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 188845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:07:22+00:00 2026-05-11T16:07:22+00:00

Can you store an image in a PHP SESSION ? I have a multi-step

  • 0

Can you store an image in a PHP SESSION ?

I have a multi-step registration process using PHP on my site. On one of the steps, the users can upload their company logo (image).

The last step is to process their credit card.

So before I write any images to the web server and image location to the database, I want to make sure their credit card is valid and process.

As such, is it possible to temporarily store that image data in the SESSION variable?

If not, how else do people temporaily store image data on forms before committing that data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:07:22+00:00Added an answer on May 11, 2026 at 4:07 pm

    You can but expect memory usage of your session to increase depending on the size of the images. In order to do so, you must save the file contents into a session variable.

    If it is in session data and you have multiple steps after the upload the image will be reloaded (into the session) every page view until the steps are complete.

    I would personally recommend against using the session for holding a binary file. Saving the image on disk into a temporary location until the registration is complete. I would only save the path to the temporary file in session. When the transaciton is completed move it to a proper location and do your db inserts.

    Also, in essence, session data is stored on disk (or db) anyway so you might as well save the image file once then issue a move command once complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a site that runs without refreshes, using Jquery and PHP
Im trying to add a multi page form, in php with zend framework, where
I have the following pages: page1.php, page2.php and page3.php. Code in each of them
When a user arrives at my site, a session is started for them. There
I have an image upload form in a secured (with Redux) admin area of
I have contact management / CRM application used in-house by our company, It is
Today I noticed that a few Google advertisements in an adsence block on one
I am creating a service that allows my website visitors to create content (text)
I am developing a web-based user interface that plots some data from a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.