输入类型文件正在上传的文件的最大数量 [英] Maximum number of files being uploaded by input type file

查看:160
本文介绍了输入类型文件正在上传的文件的最大数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

可以同时上传最大文件数量


我想用html和php上传多个文件

 < input type =file name =upload []accept =image / gif,image / jpeg,application / x-tar,application / x-zip-compressedmultiple =true> 

在php中使用

  print count($ _ FILES ['upload']); 

即使我已经在html中选择了20,我总能得到最多5个文件。
我该怎么做才能上传20个文件?

解决方案

需要在php.ini文件中进行更改,并增加 max_file_uploads 的限制(它现在必须在服务器上5)

还请确保对这些参数进行相关更改(如果需要)

  upload_max_filesize 
post_max_size
max_input_time
max_execution_time






LevSahakyan解决了问题。



他正在使用

  ($ i = 0; $ i< count($ _ FILES ['upload']); $ i ++)



<因为上传是一个数组本身,并有5个参数(名称,类型,tmp_name,错误和大小),它只上传5项。
现在他正在使用正确的参数 -

$ p $ for($ i = 0; $ i< count($ _ FILES [ 'upload'] ['name']); $ i ++)


Possible Duplicate:
Max file number can php upload at same time

I'm trying to upload multiple files using html and php

<input type="file" name="upload[]" accept="image/gif, image/jpeg, application/x-tar, application/x-zip-compressed"  multiple="true">

in php when using

print count($_FILES['upload']);

I always get maximum 5 files even if I've selected 20 in html. What should I do to be able to upload, let's say, 20 files at a time?

解决方案

you may need to change in php.ini file and increase the limit of max_file_uploads (it mustbe 5 in your server now)

Also make sure to make relevant changes to these parameters (if needed)

upload_max_filesize
post_max_size
max_input_time
max_execution_time


LevSahakyan solved the problem.

He was using

for($i=0; $i<count($_FILES['upload']); $i++)

and because 'upload' is an array itself and has 5 parameters (name, type, tmp_name, error and size) it was uploading only 5 items. now he is using right parameter -

for($i=0; $i<count($_FILES['upload']['name']); $i++)

这篇关于输入类型文件正在上传的文件的最大数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆