Connecting Tech Pros Worldwide Forums | Help | Site Map

Using files array in another page ?

Familiar Sight
 
Join Date: May 2007
Posts: 137
#1: Jun 19 '08
in my site I'm having gallery page that you can upload your pictures in steps first step you upload the picture then go to another page, my problem is i want to use this file that have been uploaded in temp folder in the second page because in the finale step i will upload it in database ,how can i do that?

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,940
#2: Jun 19 '08

re: Using files array in another page ?


I'm not sure you can pass around file data.

Why not just upload it in the first page, then pass the url with a session through the rest of the pages?
Familiar Sight
 
Join Date: May 2007
Posts: 137
#3: Jun 19 '08

re: Using files array in another page ?


what if i saved the binary date of the file in the session for it and use it for another page is that ok or not?
Newbie
 
Join Date: Jun 2008
Posts: 25
#4: Jun 20 '08

re: Using files array in another page ?


why don't you switch the steps? the steps:
1. user enter his info
2. user upload his photo
3. save all data to database

then you don't have to read $_FILES from previous page.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,748
#5: Jun 20 '08

re: Using files array in another page ?


Could you not simply upload the image to the database in step one?
Why wait till step three?
Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,940
#6: Jun 21 '08

re: Using files array in another page ?


Quote:

Originally Posted by Atli

Could you not simply upload the image to the database in step one?
Why wait till step three?

We think alike.
;]
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#7: Jun 22 '08

re: Using files array in another page ?


Heya, Smartic.

An alternative would be to move the file to a secondary location on your server (you can't rely on its location in the temp directory, since it could be erased).

The only problem is that you then are going to want to have some sort of garbage collection routine (to remove "step 1" uploads that never made it to step 3).
Reply