php php同时上传的最大文件数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3564796/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Max file number can php upload at same time
提问by albanx
I am using the tag for uploading multiple files with php. I notice that if i choose more than 20 files php uploads only the first 20 files.Is there a way to expand this limit?
我正在使用该标签通过 php 上传多个文件。我注意到如果我选择超过 20 个文件,php 只会上传前 20 个文件。有没有办法扩大这个限制?
回答by Artefacto
This limit was added in PHP 5.3.1, to avoid a type of DOS attack: temporary files exhaustion.
这个限制是在 PHP 5.3.1 中添加的,以避免一种 DOS 攻击:临时文件耗尽。
Added "max_file_uploads" INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion. (Ilia)
添加了“max_file_uploads”INI指令,默认情况下可以将每个请求的文件上传数量限制为20,以防止通过临时文件耗尽可能出现的DOS。(伊利亚)
(changelog for PHP 5.3.1)
(PHP 5.3.1 的变更日志)
You can increase this limit by changing the max_file_uploads
directive.
您可以通过更改max_file_uploads
指令来增加此限制。
回答by shamittomar
The size of total upload is limited and not the number of files. You can change the total size by editing this line in php.ini
:
总上传的大小是有限的,而不是文件的数量。您可以通过编辑以下行来更改总大小php.ini
:
post_max_size = 256M
Or more. So, if you want to upload 50 files, each of 100 MB, then you should set this limit more than 5000 MB.
或者更多。因此,如果您要上传 50 个文件,每个文件 100 MB,那么您应该将此限制设置为 5000 MB 以上。
回答by Piotr Müller
I think that is not 20 limit fault, but php config post_max_size and upload_max_filesize or bad handling of your upload form. Can you show us a sample source of your form and handling ?
我认为这不是 20 限制错误,而是 php 配置 post_max_size 和 upload_max_filesize 或上传表单处理不当。你能向我们展示你的表格和处理的样本来源吗?
回答by ncs
see upload_max_filesize
in php.ini
upload_max_filesize
在php.ini 中看到