You are here: Re: can you set FILES[] variables to session variables? « PHP Programming Language « IT news, forums, messages
Re: can you set FILES[] variables to session variables?

Posted by Rik on 10/17/06 19:59

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация