PHP在$ _FILES中缺少tmp_name

时间:2018-02-19 14:53:48

标签: php file-upload

直到上周才有可能将文件上传到我们的服务器。 但现在它是不可能的,我得到错误代码“6”(UPLOAD_ERR_NO_TMP_DIR)。

array(2) {
 ["doc_file1"]=>
   array(5) {
     ["name"]=>
     string(21) "123.pdf"
     ["type"]=>
     string(0) ""
     ["tmp_name"]=>
     string(0) ""
     ["error"]=>
     int(6)
     ["size"]=>
     int(0)
}
["doc_file2"]=>
  array(5) {
    ["name"]=>
    string(0) ""
    ["type"]=>
    string(0) ""
    ["tmp_name"]=>
    string(0) ""
    ["error"]=>
    int(4)
    ["size"]=>
    int(0)
 }
}

我们没有改变任何东西,所以我不知道。

我读过如果在php.ini中没有设置“上传目录”,php会占用系统tmp目录吗?!

我尝试了sys_get_temp_dir()并返回“/ tmp”。

所以我不知道为什么我现在得到这个错误?!有什么想法可以解决吗?

我要上传的文件大小为91kb。

1 个答案:

答案 0 :(得分:0)

感谢大家的帮助,问题是tmp目录下的权限/所有者。 我们不会改变它,但我们改变了它,现在效果很好。

相关问题