• <i id='cQBB9'><tr id='cQBB9'><dt id='cQBB9'><q id='cQBB9'><span id='cQBB9'><b id='cQBB9'><form id='cQBB9'><ins id='cQBB9'></ins><ul id='cQBB9'></ul><sub id='cQBB9'></sub></form><legend id='cQBB9'></legend><bdo id='cQBB9'><pre id='cQBB9'><center id='cQBB9'></center></pre></bdo></b><th id='cQBB9'></th></span></q></dt></tr></i><div id='cQBB9'><tfoot id='cQBB9'></tfoot><dl id='cQBB9'><fieldset id='cQBB9'></fieldset></dl></div>

        • <bdo id='cQBB9'></bdo><ul id='cQBB9'></ul>
        <tfoot id='cQBB9'></tfoot>

        <small id='cQBB9'></small><noframes id='cQBB9'>

        <legend id='cQBB9'><style id='cQBB9'><dir id='cQBB9'><q id='cQBB9'></q></dir></style></legend>

        PHP 一次只能看到 20 个上传文件

        PHP see only 20 uploading files at a time(PHP 一次只能看到 20 个上传文件)
        <legend id='CM1T2'><style id='CM1T2'><dir id='CM1T2'><q id='CM1T2'></q></dir></style></legend>
          <bdo id='CM1T2'></bdo><ul id='CM1T2'></ul>

            <tbody id='CM1T2'></tbody>

                <i id='CM1T2'><tr id='CM1T2'><dt id='CM1T2'><q id='CM1T2'><span id='CM1T2'><b id='CM1T2'><form id='CM1T2'><ins id='CM1T2'></ins><ul id='CM1T2'></ul><sub id='CM1T2'></sub></form><legend id='CM1T2'></legend><bdo id='CM1T2'><pre id='CM1T2'><center id='CM1T2'></center></pre></bdo></b><th id='CM1T2'></th></span></q></dt></tr></i><div id='CM1T2'><tfoot id='CM1T2'></tfoot><dl id='CM1T2'><fieldset id='CM1T2'></fieldset></dl></div>
                <tfoot id='CM1T2'></tfoot>

                  <small id='CM1T2'></small><noframes id='CM1T2'>

                  本文介绍了PHP 一次只能看到 20 个上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我尝试一次上传超过 20 个文件时,Web 服务器只会看到前 20 个文件.任何其他文件都将被忽略.有什么问题?

                  When I try to upload more than 20 files at a time, then the web server see only first 20. Any other files are just ignored. What is the problem?

                  简单代码尝试:

                  <form action="index.php" method="post" enctype="multipart/form-data">
                  <?php
                  if($_FILES){
                      print_r($_FILES);
                  }
                  else{
                      for($i = 0; $i < 30; $i++)
                      {
                          echo '<input type="file" name="file'.$i.'"><br/>';
                      }
                  }
                  ?>
                  <input type="submit" value="go">
                  </form>
                  

                  print_r() 输出:

                  Array ( [file0] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpD42.tmp [error] => 0 [size] => 274217 ) [file1] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpD52.tmp [error] => 0 [size] => 274217 ) [file2] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpD73.tmp [error] => 0 [size] => 274217 ) [file3] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpD83.tmp [error] => 0 [size] => 274217 ) [file4] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpD94.tmp [error] => 0 [size] => 274217 ) [file5] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpDB4.tmp [error] => 0 [size] => 274217 ) [file6] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpDC5.tmp [error] => 0 [size] => 274217 ) [file7] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpDE5.tmp [error] => 0 [size] => 274217 ) [file8] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpDF5.tmp [error] => 0 [size] => 274217 ) [file9] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE06.tmp [error] => 0 [size] => 274217 ) [file10] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE26.tmp [error] => 0 [size] => 274217 ) [file11] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE37.tmp [error] => 0 [size] => 274217 ) [file12] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE57.tmp [error] => 0 [size] => 274217 ) [file13] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE68.tmp [error] => 0 [size] => 274217 ) [file14] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE78.tmp [error] => 0 [size] => 274217 ) [file15] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpE98.tmp [error] => 0 [size] => 274217 ) [file16] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpEB9.tmp [error] => 0 [size] => 274217 ) [file17] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpEC9.tmp [error] => 0 [size] => 274217 ) [file18] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpEE9.tmp [error] => 0 [size] => 274217 ) [file19] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:	mpphpEFA.tmp [error] => 0 [size] => 274217 ) )
                  

                  .htaccess:php_value max_file_uploads 100 - 没有帮助

                  .htaccess: php_value max_file_uploads 100 - doesn't help

                  ini_set('max_file_uploads', 100) - doesn't help
                  

                  我刚刚在本地服务器上的 php.ini 中添加了一行:

                  I just added line to php.ini on my local server :

                  max_file_uploads = 100
                  

                  这很有帮助.但我不认为宿主在客户端的网络服务器上改变它.不编辑 php.ini.

                  And it's helped. But I don't think that the hoster change it on client's web server. It would be very cool effect on this value without editing php.ini.

                  推荐答案

                  设置max-file-uploads 设置更高(是的,这是一个新"设置).

                  Set the max-file-uploads setting higher (yes, it's a 'newish' setting).

                  它是 PHP_INI_SYSTEM,所以它可以设置在php.ini 或 webserver/apache 配置.恐怕没有 .htaccess 或脚本内"访问权限.

                  It's PHP_INI_SYSTEM, so it can either be set in php.ini or webserver/apache configuration. No .htaccess or 'in-script' access I'm afraid.

                  这篇关于PHP 一次只能看到 20 个上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)

                      <bdo id='EaD6d'></bdo><ul id='EaD6d'></ul>
                      <tfoot id='EaD6d'></tfoot>
                        <tbody id='EaD6d'></tbody>

                      <small id='EaD6d'></small><noframes id='EaD6d'>

                      <legend id='EaD6d'><style id='EaD6d'><dir id='EaD6d'><q id='EaD6d'></q></dir></style></legend>
                    • <i id='EaD6d'><tr id='EaD6d'><dt id='EaD6d'><q id='EaD6d'><span id='EaD6d'><b id='EaD6d'><form id='EaD6d'><ins id='EaD6d'></ins><ul id='EaD6d'></ul><sub id='EaD6d'></sub></form><legend id='EaD6d'></legend><bdo id='EaD6d'><pre id='EaD6d'><center id='EaD6d'></center></pre></bdo></b><th id='EaD6d'></th></span></q></dt></tr></i><div id='EaD6d'><tfoot id='EaD6d'></tfoot><dl id='EaD6d'><fieldset id='EaD6d'></fieldset></dl></div>