简体   繁体   English

PHP 在 $_FILES 中缺少 tmp_name

[英]PHP missing tmp_name in $_FILES

till last week it was possible to upload files to our server.直到上周才可以将文件上传到我们的服务器。 But now it isn't possible and i get the errorcode "6" (UPLOAD_ERR_NO_TMP_DIR).但现在这是不可能的,我得到了错误代码“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)
 }
}

We haven't changed anything, so nothing that i know.我们没有改变任何东西,所以我什么都不知道。

I read that if no "Upload Dir" is set in the php.ini, php take the system tmp directory?!我读到如果php.ini中没有设置“上传目录”,php会占用系统tmp目录?!

I tried sys_get_temp_dir() and get back "/tmp".我尝试了 sys_get_temp_dir() 并返回“/tmp”。

so i don't know why i get this error now?!所以我不知道为什么我现在收到这个错误?! Any ideas to solve it?任何想法来解决它?

The size of the file i want to upload is 91kb.我要上传的文件大小为 91kb。

Thx to all for your help, the problem was the permissions/owner on the tmp directory.感谢所有人的帮助,问题是 tmp 目录的权限/所有者。 We don't who had changed it but we changed it and now it works great.我们不知道是谁改变了它,但我们改变了它,现在它工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM