The receipt parameters of the form can be obtained by using an array of $_get or $_post, but the file field, although shown to be post, must use the $_files.
Differences between 1.$_get ($HTTP _get_vars) and $_post ($HTTP _post_vars)
2.$_files uploading and receiving files
2.1 Issues that you may encounter when uploading files
What are the keys of 2.2$_files
Name, type, size, tmp_name
2.3is_uploaded_file () method
2.4move_uploaded_file () method
------------------------------------------------------
Issues that you may encounter when uploading files
Note: The resulting file is too large to handle
Workaround 1: Remove the hard limit and change the upload_max_filesize option in php.ini to 2 megabytes or more for the length of the uploaded file
Workaround 2: Submit a parameter named Upload_max_filesize before the file field is submitted, then PHP will use that value as a soft limit for file size.
2.2 Key value of $_files
1.name the file name provided by the browser.
2.type the MIME type of the uploaded file.
3.size the size (in bytes) of the uploaded file.
4.tmp_name a temporary file name for uploading files in the server.
-----------------------------------------------------------
Form processing
Is_uploaded_file () method
Format:
if (Is_uploaded_file ($_files[' toprocess ' [' tmp_name ']))
{
Upload successful
}
Detects if a file has been successfully uploaded
Is_uploaded_file ($_files[' toprocess ' [' Tmp_name '], "path/to/put/file/$file")
/Move the uploaded file from the Temp folder to the specified directory, and when this method is called, the file is automatically detected for upload.
PHP File Upload