javascript-php Unable to upload file (777+group:apache+ selinux disabled)

Source: Internet
Author: User
Title, Centos7
Upload_temp_dir=/tmp (777)
$_server[' Document_root '. '/adpic ' (777)

 !--? php//detection file if (!isset ($_files[' file ']) | |!is_uploaded_file ($_files [' File ']    [' Tmp_name '])) Exit (' Error, File not found '. Json_encode (Var_dump ($_files))); if ($_files[' file ' [' Error ']--> 0) exit (' Error, file error '); if ($_files['        File ' [' Size '] < 0) exit (' Error, File size unknown ');//switch (getimagesize ($_files[' file ' [' Tmp_name ']) [2]) {//Case 1://         $ext = ' gif ';//break;//case 2://$ext = ' jpg ';//break;//case 4://$ext = ' jpeg ';// break;//case 3://$ext = ' png ';//break;//default://die (' only images in PNG gif jpg are allowed to be uploaded. Var_dump ($_files));//break;//}//file path filename = time (); $imgName = $time. Mt_rand (10000, 99999); $savePath =$_server[' Document_root ']. '/adpic ';//Create Folder//Move file if (!move_uploaded_file ($_files[' file '] [' tmp_name '], $savePath. '/' . $imgName. '.' . $ext)) exit (' Error, file move failed '. error_reporting (E_all));//returns the file address exit ("/adpic/". $imgName. '.' . $ext);  

The first problem is that getimagesize ($_files ' file ') is false, what is the situation?
Normal should not be able to get it?
Then the error message is 22527.
The problem description is probably the case, if you need more information I will update immediately, thank you for the answer.

Reply content:

Title, Centos7
Upload_temp_dir=/tmp (777)
$_server[' Document_root '. '/adpic ' (777)

 !--? php//detection file if (!isset ($_files[' file ']) | |!is_uploaded_file ($_files [' File ']    [' Tmp_name '])) Exit (' Error, File not found '. Json_encode (Var_dump ($_files))); if ($_files[' file ' [' Error ']--> 0) exit (' Error, file error '); if ($_files['        File ' [' Size '] < 0) exit (' Error, File size unknown ');//switch (getimagesize ($_files[' file ' [' Tmp_name ']) [2]) {//Case 1://         $ext = ' gif ';//break;//case 2://$ext = ' jpg ';//break;//case 4://$ext = ' jpeg ';// break;//case 3://$ext = ' png ';//break;//default://die (' only images in PNG gif jpg are allowed to be uploaded. Var_dump ($_files));//break;//}//file path filename = time (); $imgName = $time. Mt_rand (10000, 99999); $savePath =$_server[' Document_root ']. '/adpic ';//Create Folder//Move file if (!move_uploaded_file ($_files[' file '] [' tmp_name '], $savePath. '/' . $imgName. '.' . $ext)) exit (' Error, file move failed '. error_reporting (E_all));//returns the file address exit ("/adpic/". $imgName. '.' . $ext);  

The first problem is that getimagesize ($_files ' file ') is false, what is the situation?
Normal should not be able to get it?
Then the error message is 22527.
The problem description is probably the case, if you need more information I will update immediately, thank you for the answer.

has been resolved, compared to the php.ini, found to be the reason for the value of Open_basedir, empty after the return to normal.

  • 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.