【问题标题】:HTML input type="file" too many files in Chrome? [duplicate]HTML input type="file" Chrome 中的文件太多? [复制]
【发布时间】:2016-10-14 01:57:48
【问题描述】:

鉴于这个最小、完整且可验证的示例:

<html>
  <head>
    <script>
      var handleFiles = function(event) {
        console.log('# of files: ' + event.target.files.length);
      };
    </script>
  </head>
  <body>
    <input type="file" onchange="handleFiles(event)" multiple/>
  </body>
</html>

我无法在 Chrome 中选择我的 1682 个文件的测试用例(尽管它适用于 Firefox)。我的测试用例是 316 兆字节,所以我将它精简到一个文件夹,其中包含相似数量的文件,但包含一个字符的简单文本文件。问题仍然存在。 Chrome 处理此控件的实现是否存在问题?如果是这样,是否有 polyfill?如何在 Chrome 中选择 1682 个文件?

【问题讨论】:

    标签: html google-chrome input file-browser


    【解决方案1】:

    看起来它不起作用,因为上传受到所有文件名组合中的字符总数的限制。限制似乎是大约 32K 个字符。

    查看这些:

    What is the max number of files to select in an HTML5 [multiple] file input?

    https://bugs.chromium.org/p/chromium/issues/detail?id=44068

    【讨论】:

    猜你喜欢
    • 2011-04-01
    • 2021-08-30
    • 2010-09-23
    • 2019-01-27
    • 2011-08-17
    • 1970-01-01
    • 1970-01-01
    • 2019-11-16
    相关资源
    最近更新 更多