Analysis of Error Types of Upload File Printing Errors in PHP
- 2021-12-05 05:49:36
- OfStack
When you use $_FILES to upload files, you can use the
$_FILES["file"]["error"]
To determine whether there is an error in file uploading.
$_FILES["file"]["error"]
The corresponding error code is returned:
UPLOAD_ERR_OK
Its value is 0, no errors occurred, and the file was uploaded successfully.
UPLOAD_ERR_INI_SIZE
Its value is 1, and the uploaded file exceeds that in php. ini
upload_max_filesize
Gets or sets the value restricted by the.
UPLOAD_ERR_FORM_SIZE
With a value of 2, the uploaded file size exceeds the value specified by the MAX_FILE_SIZE option in the HTML form.
UPLOAD_ERR_PARTIAL
Its value is 3, and only part of the file is uploaded.
UPLOAD_ERR_NO_FILE
Its value is 4, and no files are uploaded.
UPLOAD_ERR_NO_TMP_DIR
With a value of 6, the temporary folder could not be found. PHP 4.3. 10 and PHP 5.0. 3 were introduced.
UPLOAD_ERR_CANT_WRITE
Its value is 7, and the file write failed. PHP 5.1. 0 was introduced.
Summarize
Above is this site to introduce you in PHP uploaded file printing error type analysis, I hope to help you, if you have any questions welcome to leave me a message, this site will reply to you in time!