An error occurred while uploading data in linux. tmp_name is empty.

Source: Internet
Author: User
Failed to upload files in linux environment tmp_name is empty phpinfo the following information is displayed: file_uploadsOnupload_max_filesize2Mupload_tmp_dir/Users/ririn/Sites/tmp then & nbs tmp_name is empty when the file fails to be uploaded in linux
Phpinfo displays the following information:
File_uploadsOn
Upload_max_filesize2M
Upload_tmp_dir/Users/ririn/Sites/tmp
Then I set the 777 permission for this directory chmod 777/Users/ririn/Sites/tmp. Is there anything else to set?
But I still cannot upload files.
First, the tmp directory does not contain any files.
Of course, $ tmp = $ _ FILES ['mypic '] ['tmp _ name'] is used in the background. this cannot be obtained either...

In win, the configuration in win is normal. the configuration here is the same as that in win. the selected file is only over 100 kB.

I still need to post my code, isn't it linux? what should I add?



$ Tmp = $ _ FILES ['mypic '] ['tmp _ name']; // empty
$ Name = $ _ FILES ['mypic '] ['name'];
$ Size = $ _ FILES ['mypic '] ['size'];
$ Arr = array (
'Tmp '=> $ tmp,
'Name' => $ name,
'Size' => $ size
);
Var_dump ($ arr );

?>
The last print is array (3) {["tmp"] => string (0) "" ["name"] => string (9) "scoot.png" ["size"] => int (0 )}
In Windows, the upload permission for Linux is completely normal and shared:
------ Solution --------------------
You can directly print_r ($ _ FILE) on the php page pointed to by form to test whether there is any result.
------ Solution --------------------
Var_dump ($ _ FILES );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.