【问题标题】:jquery file upload with blueimp fails when file selected in multiple iterations在多次迭代中选择文件时,使用 blueimp 上传 jquery 文件失败
【发布时间】:2014-07-25 06:18:53
【问题描述】:

我正在使用 blueimp 文件上传。当我同时选择多个文件时,文件上传功能对我有用,即当我从单个文件夹中选择多个文件并上传它们时,该功能工作正常,我的所有文件都被上传。

但问题是当我在不同的迭代中选择多个文件时,即第一次迭代中的单个文件,第二次迭代中的单个文件等等。所以在这种情况下,只有我选择的最后一个文件被上传。文件上传会忘记之前选择的文件。

我试过sequentialUploads = true。但这无济于事。

您知道如何上传在不同迭代中选择的多个文件吗?

【问题讨论】:

  • 当我使用这个插件时,我没有遇到你的问题,但是我使用了一个模式来序列化我的表单参数,因为我想发送额外的字段。像这样的东西:
      $('#fileupload').bind('fileuploadsubmit', function (e, data) { var inputs = data.context.find(':input'); if (inputs. filter(function () { return !this.value && $(this).prop('required'); }).first().focus().length) { data.context.find('button').prop ('disabled', false); return false; } data.formData = inputs.serializeArray(); }); 
    试一试...

标签: jquery file-upload jquery-file-upload blueimp


【解决方案1】:

Es necesario mantener el campo name modo array y la opcion "multiple"

<input type="file" name="foto[]"  id="fileFoto" multiple >

【讨论】:

    猜你喜欢
    • 2015-10-03
    • 2019-01-26
    • 2013-02-13
    • 1970-01-01
    • 2014-12-10
    • 1970-01-01
    • 1970-01-01
    • 2018-10-02
    • 2016-05-03
    相关资源
    最近更新 更多