Re: Upload dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/12/11 kranthi <kranthi117@xxxxxxxxx>:
> How can i change the temporary upload directory?
> var_dump(ini_get('upload_tmp_dir'));      gives me (and that is set in php.ini)
> string '/var/www/cgi-bin' (length=16)
>
> but
> var_dump($_FILES)                                                     gives me
> 'tmp_name' => string '/tmp/phpbSZ6WP' (length=14)
>
> var_dump(file_exists($_FILES['file']['tmp_name']));  gives me  (/tmp
> has permissions drwxrwxrwt and i never used file_move_upload or any
> similar functions)
> boolean false
>
> am I missing something here?
> Kranthi.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Just assuming you could alter the upload_tmp_dir setting in your code
(you can't) ...

PHP puts the uploaded files into the upload_tmp_dir BEFORE your script
runs, so changing it in your script essentially hides the uploaded
files.

PHP drops the files into directory A.
PHP then runs your code.
Your code changes the directory to B.
Your code cannot see the files PHP put into A as your code is now looking in B.

But, as I said earlier, you can't use your code to change
upload_tmp_dir. It can only be done at the system level (php.ini or
httpd.conf). See [1] and [2].

Regards,

Richard Quadling.

[1] http://docs.php.net/manual/en/ini.core.php#ini.sect.file-uploads
[2] http://docs.php.net/manual/en/configuration.changes.modes.php

-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux