Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

will uploaded files to the tmp folder stick around through a session

Status
Not open for further replies.

justride

Programmer
Jan 9, 2004
251
US
I coded a form that has unlimited file uploades that are stores in session variables within an array. When I retrieve the variables on my new page and try and add to the db, the file names and tmp_names are present however I cannot move them to the new folder on my server, I dont receive any error but the files arent phyically there.

I'm not sure if its me or if the tmp files get deleted.

maybe im initializing wrong?
 
Code:
session_start();
$source = $HTTP_POST_FILES['file']['tmp_name'];
$_SESSION['mysource'] = $source; 
echo 'MYSOURCE'.$mysource; //produces nothing
echo 'SOURCE'.$source; //produces the source of the file

however although I have the source on my later pages I think the file has been deleted already. I'm thinkign if the session var could work then maybe it would stick around?

Thasnks
 
try:
Code:
session_start();
$source = $HTTP_POST_FILES['file']['tmp_name'];
$_SESSION['mysource'] = $source; 
echo 'MYSOURCE'.$_SESSION['mysource']; //out put the same as $source
echo 'SOURCE'.$source;
hope it helps

Regards,

Martin

Computing Help And Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top