Modify PHP.ini
1.file_uploads=on/off
Whether to allow uploading of files via HTTP
2.max_execution_time=30
Allow the maximum execution time of the script, which will be an error over this time
3.upload_max_filesize=20m
Maximum size allowed for uploaded files, this instruction must be less than post_max_size
4.upload_tmp_dir
Upload Files Temporary storage directory
5.post_max_size=30m
Allow post mode to accept maximum size
$_files[' myFile ' [' Name '] The original name of the client's last file.
The MIME type of the $_files[' myFile ' [' type '] file requires the browser to provide support for that information, such as "Image/gif".
$_files[' myFile ' [' size '] the size of the uploaded file, in bytes.
$_files[' myFile ' [' tmp_name '] files are uploaded after the temporary file name stored on the server, usually the system default. Can be specified in the php.ini upload_tmp_dir, but the putenv () function setting is not working.
$_files[' myFile ' [' Error '] and the file upload related status code. [' ERROR '] was added in version PHP 4.2.0. Here is a description of it: (they become constants after PHP3.0)
Upload_err_ok
Value: 0; No error occurred and the file upload was successful.
Upload_err_ini_size
Value: 1; The uploaded file exceeds the value of the Upload_max_filesize option limit in php.ini.
Upload_err_form_size
Value: 2; The size of the uploaded file exceeds the value specified by the Max_file_size option in the HTML form.
Upload_err_partial
Value: 3; Only part of the file is uploaded.
Upload_err_no_file
Value: 4; No files were uploaded.
Value: 5; The upload file size is 0.
After the file is uploaded, it is stored in the temp directory by default, and you must remove it from the temporary directory or move it to another location, or delete it if it is not.
That is, regardless of whether or not the upload succeeds, the files in the temp directory will be deleted after the script executes.
If the uploaded file is a large file:
1. Change the time-out for PHP:
First way: Modify php.ini inside max_execution_time=0(default = 30)
Second way: Set timeout in php script set_time_limit (0)
2. Modify the maximum size allowed for POST data
Modify the value of the post_max_size inside the php.ini
3. Modify the maximum size allowed for uploads
Modify the value of the upload_max_filesize inside the php.ini
Recommendation:post_max_size greater than upload_max_filesize is good
Need to move to the desired location after the file upload is successful
Move_uploaded_file ($_files["File" ["Tmp_name"], "path + name")
PHP path-Large File upload