Blueimp文件上传:单个文件上传 [英] Blueimp File Upload: single file upload

查看:150
本文介绍了Blueimp文件上传:单个文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Blueimp 文件上传,如何限制上传到选择的最后一个元素或(拖放)掉落?我已经从输入表单中删除了多个属性,并将 maxNumberOfFiles 选项设置为值 1 但如果第一次上传失败(因为选项 maxFileSize acceptFileTypes )第一个元素保留在列出的所选文件(由模板生成)之上,并且无法上载其他文件,因为它们侵犯了 maxNumberOfFiles 选项。我希望如果上传和/或删除接受的文件,而不是附加,它将替换旧的(未接受的)文件。我还希望模板在删除多个文件时永远不会打印多个文件,而只会打印第一个文件。

I'm using Blueimp File Upload, how can I limit the upload to the last single element selected or (drag and) dropped? I already deleted the multiple attribute from input form and I set the maxNumberOfFiles option to the value 1 but if the first upload fails (because of the option maxFileSize or acceptFileTypes) the first element stays on top of the listed selected files (generated by template) and further files cannot be uploaded because they infringe the maxNumberOfFiles option. I'd desire that if an accepted file is upload and/or dropped, instead of being appended, it would replace the old (not accepted) file. I would also that the templates never prints more than one file when multiple files are dropped but only the first file.

推荐答案

更改输入标签来自:
< input type =filename =files []>

to:< br>
< input type =filename =file>

change input tag from:
<input type="file" name="files[]">
to:
<input type="file" name="file">

这篇关于Blueimp文件上传:单个文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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