|
Posted by mantrid on 10/19/06 17:48
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
news:7d6aa$453535d6$8259c69c$4052@news1.tudelft.nl...
> mantrid wrote:
> > I have some code to upload files to my site. it works when the <input
> > type="file" > is posted once even when I use session variables from
> > the posted variables but when I carry those session variables to a
> > new page the upload will not work. despite the variables being set. I
> > have echoed then on the second page and they display correctly but
> > they just dont work in the move_uploaded_file() function. I get the
> > error message
>
> I haven't read the code, but I suspect the problem is this:
> 1. The user uploads the file.
> 2. File arrives perfectly.
> 3. Session variables are set. ($_SESSION['files'] = $_FILES;)
> 4. File is DELETED from the temp directory because the request ends.
> 5. Second page comes up, with perfect session variables, but the files are
> no longer there.
>
> In this case, you'd have to move it to your own custom tmp directory
first,
> which you will have to clean up, because the server won't do that anymore
> for you.
>
> Another option is you use $_SESSION = $_FILES. Don't. Set it in a specific
> $_SESSION key.
>
> Grtz,
> --
> Rik Wasmus
>
>
Yes that makes sense
That is probably what is happening as the code works fine otherwise, even
using sessions. However stops working if it is propergated onwards to more
than one page. yes it looks like i will have to use an alternate directory
for the temp file.
Thanks
[Back to original message]
|