PHP upload cannot find a workaround for temporary folders

Source: Internet
Author: User
This article mainly introduces the PHP upload can not find a temporary folder solution, the main processing method is to find the PHP configuration file php.ini and make the corresponding changes, the specific solution for your reference under this article

Recently encountered such trouble, unable to find the temporary folder returned error code 6

Cause of Error:

One, the configuration file does not have a temporary folder set

Second, the temporary folder does not have or the parent folder does not have the appropriate permissions

Processing method:

Locate the PHP configuration file php.ini, and locate the following code

;upload_tmp_dir =

Switch

Upload_tmp_dir = "C:/windows/temp"  //The following folder path is set according to your system

If the permissions are insufficient, you can add the appropriate permissions to the files according to the operating system.

Other knowledge:

$_FILES['file']['error']

The value is 0, no error occurred and the file upload was successful.

The value is 1 and the uploaded file exceeds the upload_max_filesize option limit in php.ini.

Its value is 2, and the size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form.

The value is 3, and the file is only partially uploaded.

Its value is 4 and no files are uploaded.

The value is 6 and the Temp folder cannot be found. PHP4.3.10 and PHP5.0.3 introduced.

The value is 7, and the file write fails. PHP5.1.0 introduced.

If the newspaper is wrong, it should be temporary folder does not have write permission or does not exist

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.