Forum Moderators: coopster

Message Too Old, No Replies

upload tmp dir

         

offline

10:31 am on Sep 11, 2007 (gmt 0)

10+ Year Member



How its possible to change the upload_tmp_dir on the fly (within a script)?

whoisgregg

5:28 pm on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't believe it's possible to change it within a script. Namely because by the time the script executes, the file has already been uploaded and placed in the tmp dir.

The PHP manual page for handling file uploads [us3.php.net] mentions (my bold):

Files will, by default be stored in the server's default temporary directory, unless another location has been given with the upload_tmp_dir directive in php.ini. The server's default directory can be changed by setting the environment variable TMPDIR in the environment in which PHP runs. Setting it using putenv() from within a PHP script will not work.