Home >Backend Development >PHP Tutorial >Simple analysis of PHP file upload principle_PHP tutorial
//Form uploads can only use the multipart/form-data encoding format
$_FILES system function;
$_FILES['myFile']['name']File name
$_FILES['myFile'][ 'type'] file type, restricted by the server
image/**
image/x-png
application/x-zip-compressed
$_FILES['myFile']['size ']Upload file size
$_FILES['myFile']['tmp_name'] Save temporary file name after uploading service
$_FILES['myFile']['error'] Error code;
0 Success 1 Exceeds php.ini size 2 Exceeds the value specified by the MAX_FILE_SIZE option
3 Only partially uploaded 5 Uploaded file size is 0
move_uploaded_file (temporary file, target location and file name);
Moved after upload The function that files to the target location
is_uploaded_file(MIME);
The file function that determines the uploaded MIME type