Home >Backend Development >PHP Tutorial >Error type of php file upload error

Error type of php file upload error

不言
不言Original
2018-04-18 15:39:402912browse

The content of this article is about the error types of PHP file upload errors. It has certain reference value. Now I share it with you. Friends in need can refer to it.

The error types of PHP file upload errors





#$FILES[ 'file' ][ 'error'] There are 7 types in total:

1, UPLOAD_ERR_OK

The value is 0, no error occurs, and the file is uploaded successfully.

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


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


4. UPLOAD_ERR_PARTIALThe value is 3, and only part of the file is uploaded.


5. UPLOAD_ERR_NO_FILEThe value is 4 and no file is uploaded.


##6, UPLOAD_ERR_NO_TMP_DIR

The value is 6 and the temporary folder cannot be found. PHP 4.3.10 and PHP 5.0.3 introduced.


7, UPLOAD_ERR_CANT_WRITE

The value is 7, file writing failed. PHP 5.1.0 introduced.

Related recommendations:

php file operation-add data from other files to this file

php file lock solves high concurrency

The above is the detailed content of Error type of php file upload error. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn