What are the types of php file upload errors?

王林
Release: 2023-03-02 18:08:02
Original
3202 people have browsed it

php file upload error types are: 1. UPLOAD_ERR_OK, a value of 0 means that no error occurred and the file was uploaded successfully; 2. UPLOAD_ERR_INI_SIZE, a value of 1 means that the uploaded file exceeds the limit of the upload_max_filesize option.

What are the types of php file upload errors?

php file upload error types are:

(recommended tutorial: php tutorial)

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 limit of the upload_max_filesize option in php.ini.

3. UPLOAD_ERR_FORM_SIZE

The 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_PARTIAL

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

5. UPLOAD_ERR_NO_FILE

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

The above is the detailed content of What are the types of php file upload errors?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template