开发者

File uploading - I need to find the absolute (full) path of the tmp_name in PHP

开发者 https://www.devze.com 2023-03-06 11:55 出处:网络
While upload a file i will get the tmp_name开发者_StackOverflow中文版 in the array, I need to find the absolute (full) path of the tmp_name that means in which path the file is there( like var/www/sam

While upload a file i will get the tmp_name开发者_StackOverflow中文版 in the array, I need to find the absolute (full) path of the tmp_name that means in which path the file is there( like var/www/sample/tmp/phpekIgfr)

Array
(
    [name] => profile.jpg
    [type] => image/jpeg
    [tmp_name] => /tmp/phpekIgfr
    [error] => 0
    [size] => 44288
)


tmp_name will always contain the full path.

/tmp/phpeklgfr points to the uploaded file in the root /tmp directory. It does not reside in /var/www/sample/tmp.

You can change the location PHP stores temporary files in using the upload_tmp_dir php.ini setting.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号