views:

31

answers:

2

Hi ,

Say if I upload a file on page 1 and submit the form

How can I make a session with the file which has been uploaded

for example

how would I get the session to store the file ?

+1  A: 

You can store the file somewhere temporary and keep the path in the session. once the user completes whatever he/she supposed to complete then you store the file to a permanent location.

Your best bet is to store the location of the file in the session. better ideas?

How could I then use that file in another file upload form ? Basically I have 2 forms which need the same file but both have 2 different process and I don't want the user to upload the file twice.
Oliver Bayes-Shelton
You put a link to file which will point to temporary location. So user wont have to upload it twice, but user can uncheck and upload another file instead, which you will need to process the former file. Pretty straight forward. Look at how gmail does and think a little harder.
A: 

A file cannot be stored in the session past the initial submit. On the file that the form calls you will need to take the temporary file and move it to a directory on your server.

Justin Lucas
Once I have done that how could I then put that file back into a form file input ?
Oliver Bayes-Shelton