Results 1 to 2 of 2
Thread: Sessions and File Uploads
Aug 18, 2008, 11:35 #1
Sessions and File Uploads
Hi. I have a form that includes a file upload field among many others. Form input is stored in session variables throughout a process that spans a few pages. If the user makes an error or leaves out a required field, whatever he did enter disappears when he's bounced back to the previous page unless I use the session variables to fill them in. No problem there, except for the file upload field, which comes up blank no matter what I do. That is, although I store the original uploaded file name in a session variable, I don't seem to be able to user that variable to fill in the file upload field, and the user has to re-browse to the file on his computer. This isn't a huge deal, and part of me feels that that's what they get for not following instructions.
But... I'd still like to resolve this if possible. Any ideas? Thanks!
Aug 18, 2008, 13:28 #2
- Join Date
- Aug 2008
- The Netherlands
- 153 Post(s)
- 3 Thread(s)
You could put the images in the /tmp directory (supposing you're using *nix here). This directory is purged on every reboot, so as long as they reboot a lot it should be okay.
If not, you could also write session system using the session_set_save_handler PHP function.
Than you could create a folder for each sessionID upon creation of that session, and delete that same folder upon deletion of that sessionID.
It's not an easy task, but it would get the job done