PHP settings allow large file upload sample code

Source: Internet
Author: User
Tags file upload html form

  Use Nginx as the proxy server, the backend is apache2. Set up to allow uploading of up to 100M files, you need friends can refer to the following

Using Nginx as proxy server, the backend is apache2. Set up to allow uploading of the maximum 100M file .    1. Nginx Configuration:    http {  ......  client_max_body_size 100m;  ...... }    2. PHP configuration file   ...... ; Maximum execution time of each script, in seconds ; ; Note:this directive is hardcoded to 0 for the CLI sapi  max_execution_time = 0    ......  [Data Handl ing] ; Maximum size of POST data that PHP would accept. ;  post_max_size = 100m    ......  [File uploads] ; Maximum allowed size for uploaded files  upload_max_filesize = 100m    ......    3. $_files[file][' ERROR '] Information description     upload_err_ok  Its value is 0, no error occurred, file upload success.     upload_err_ini_size  has a value of 1, and the uploaded file exceeds the upload_max_filesize option limit in php.ini.     upload_err_form_size  Its value is 2, the size of the uploaded file exceeds the value specified by the Max_file_size option in the HTML form.     Upload_err_partial  its value is 3, the file is only partially uploaded.     upload_err_no_file  Its value is 4 and no files are uploaded.     upload_err_no_tmp_dir  Its value is 6, temporary folder cannot be found. PHP 4.3.10 and PHP 5.0.3 introduced.     upload_err_cant_write  Its value is 7, file write failed. PHP 5.1.0 introduced.  
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.