Whenever you upload a file using PHP script it will return a error code with file array. This code you will find in the error section of the file array i.e., $_FILES['filename']['error']. Code are as follows:
UPLOAD_ERR_OK: Value '0'
This means that the file uploaded successfully.
UPLOAD_ERR_INI_SIZE: Value '1'
In php.ini, set upload_max_filesize as the uploaded file exceeds this value.
UPLOAD_ERR_FORM_SIZE: Value '2'
Uploaded file exceeds MAX_FILE_SIZE directive specify in HTML form.
UPLOAD_ERR_PARTIAL: Value '3'
File uploaded partially
UPLOAD_ERR_NO_FILE: Value '4'
It means no file was uploaded.
UPLOAD_ERR_NO_TMP_DIR: Value '6'
It means the temporary folder is missing.
UPLOAD_ERR_CANT_WRITE: Value '7'
It means failed to write file on the disk.
UPLOAD_ERR_EXTENSION: Value '8'
It means PHP extension stops the file uploading.
0 Comment(s)