我有以下脚本:
<form method=post enctype="multipart/form-data">
<input type=file name=test><input type=submit></form>
<?php
echo sys_get_temp_dir();
echo '<br/>';
echo ini_get('upload_tmp_dir');
echo '<br/><pre>';
print_r($_FILES);
echo '</pre>';
这是输出:
/var/tmp/
/opt/httpd/tmp
Array
(
     [test] => Array
     (
        [name] => the-doors-logo.jpg
        [type] => image/jpeg
        [tmp_name] => /tmp/phpyeE7CX
        [error] => 0
        [size] => 80635
    )
)
在 PHP.ini 中,tmp_upload_dir 设置为“/opt/httpd/tmp”。
谁能向我解释 PHP 如何给我两个不同的 'tmp' 文件夹,而我的 FILES 中的 tmp_name 仍在 /tmp 中?