This is a discussion on put $_FILES into a session within the PHP Language forums, part of the PHP Programming Forums category; Hello, I'm trying to get my $_FILES arrays into a session because I want to move the files later ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
I'm trying to get my $_FILES arrays into a session because I want to move the files later to a specific directory (ie after I get a result_id from a sql insert). No problem putting the variables in a session but I can't move $_SESSION['userfile']['tmp_name'] anymore. $_SESSION['userfile']['error'] is 0 so I don't really see what could be the problem.... Anybody can help? Trogie |
|
|||
|
On Fri, 30 Apr 2004 02:49:10 GMT
Tom Rogie <Tom@Rogie.be> wrote: > Hello, > > I'm trying to get my $_FILES arrays into a session because I want to > > move the files later to a specific directory (ie after I get a > result_id from a sql insert). No problem putting the variables in a > session but I can't move $_SESSION['userfile']['tmp_name'] anymore. > $_SESSION['userfile']['error'] is 0 so I don't really see what could > be the problem.... I don't really see the problem. After upload, get the name of the file, move it somewhere safer and after you're ready to delete the file, delete file saved its name or do whatever you want with it. if ( move_uploaded_file ( $filename, ´/safe/place') ) $_SESSION['file']='/safe/place'.$filename; Maybe I didn't understand your question. |
|
|||
|
Hi Tom,
On Fri, 30 Apr 2004 02:49:10 GMT, Tom Rogie <Tom@Rogie.be> wrote: >Hello, > >I'm trying to get my $_FILES arrays into a session because I want to >move the files later to a specific directory (ie after I get a result_id >from a sql insert). No problem putting the variables in a session but I >can't move $_SESSION['userfile']['tmp_name'] anymore. I fell over that as well, but 'tmp_name' is only TeMPorary for the request. Next page its gone. You'll either have to copy teh file somewhere ore really read the file content into a session variable. >$_SESSION['userfile']['error'] is 0 so I don't really see what could be >the problem.... If you look on the server, its just gone. I assume because its temporary. HTH, Jochen > >Anybody can help? > >Trogie -- Jochen Daum - Cabletalk Group Ltd. PHP DB Edit Toolkit -- PHP scripts for building database editing interfaces. http://sourceforge.net/projects/phpdbedittk/ |