Modify PHP upload File size limit

Source: Internet
Author: User

1. In php.ini, make the following changes:
File_uploads = On
Upload_tmp_dir =/home/upload
Upload_max_filesize = 4000M
Post_max_size = 4000M
Generally, after setting the above four parameters, uploading <=8m files is not a problem, in the network normal situation.
However, if you want to upload a large volume of >8m files, only set the above four items will certainly be able to pass. Unless your network really 100m/s upload high speed, otherwise you have to care about the following parameters:
Max_execution_time = 600
Max_input_time = 600
Memory_limit = 128M

2. Add the following lines to the <form> to confirm the upload:
<input type= "hidden" name= "max_file_size" value= "4000000000" >
3. $_files["UserFile" ["Error"] return value Description:
$_files[' teacher_pic ' [' error '] = 1 file size exceeds file limit in php.ini
$_files[' teacher_pic ' [' error '] = 2 file size exceeds browser limit
$_files[' teacher_pic ' [' ERROR '] = 3 file part is uploaded
$_files[' teacher_pic ' [' error '] = 4 no files found to upload
$_files[' teacher_pic ' [' ERROR '] = 5 Server temp folder is missing
$_files[' teacher_pic ' [' error '] = 6 file Write to Temp folder error
$_files[' teacher_pic ' [' error '] = 1 type of final charge
$_files[' teacher_pic ' [' error '] = 2 file too large, upload file cannot exceed {$this->maxsize} bytes
$_files[' teacher_pic ' [' error '] =-3 upload failed
$_files[' teacher_pic ' [' error '] = 4 failed to set up file directory for upload, please re-specify upload directory
$_files[' teacher_pic ' [' ERROR '] = 5 must specify the path of the uploaded file

Modify PHP upload File size limit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.