如何更改多个文件输入中的文件顺序? [英] How to change order of files in multiple file input?
问题描述
默认情况下,这些文件按字母顺序排列;有什么办法来上传他们在文件选择器中选择他们的顺序吗?
我希望能够在同一个输入中选择主文件和其他额外文件,而不必提交多个输入/时间。 b $ b
文件实际上并不按字母顺序排列。他们排队在文件选择器的外观顺序(至少这是当前的Chrome和Firefox在Windows 7上工作)。您只需在选择器中按名称进行排序。
我不认为您所要求的是可能的。你可以:
列表中(但是,我相信
浏览器无法保证订单)。
The files are ordered alphabetically by default; is there any way to upload them in the order they were chosen in the file picker instead?
I want to be able to select a primary file and then other extra files in the same input without having to submit more than one input/time.
The files are actually not ordered alphabetically. They are lined in the order of appearance in the file picker (at least that is how current Chrome and Firefox work on Windows 7). You simply had them sorted by name in the picker.
I don't think what you're asking is possible. You could either:
- instruct the user to make sure the primary file is always first in the list (however, I believe there is no guarantee of the order by browsers).
- create a separate input element for the primary file.
- (recommended) display the file names (and/or content) and allow the user to select the file he wishes to be primary. Store that information in some hidden field with JavaScript.
这篇关于如何更改多个文件输入中的文件顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!