在PHP配置文件中配置属性:
;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir =E:/usr/temp/ ; Maximum allowed size for uploaded files. upload_max_filesize = 20M max_file_uploads = 20 ;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. allow_url_include = Off ; Define the anonymous ftp password (your email address) ;from="john@doe.com" ; Define the User-Agent string ; user_agent="PHP" ; Default timeout for socket based streams (seconds) default_socket_timeout = 300
如果前面有分号,则是注销,你可以用编辑工具打开来看。
开启上传、限制大小、限制个数、最后是超时时间。
Apache中则配置LimitRequestBody属性。
如:
LimitRequestBody 10485760
LimitRequestBody: Apache Limiting User Upload File Size 。