HTML multiple file upload from different folders(从不同文件夹上传 HTML 多个文件)
问题描述
我有一个带有上传字段的表单,允许用户选择多个文件.但是,我需要能够允许用户从文件夹 1 中选择文件 1,然后从文件夹 2 中选择文件 2,依此类推.
I have a form with an upload field that allows users to select multiple files. However, I need to be able to allow the user to select file 1 from folder 1, then go and select file 2 from folder 2, and so on.
目前,当用户从文件夹 1 中选择文件 1 然后点击打开"时,选择窗口将关闭(将用户留在我的表单上).然后,如果用户从文件夹 2 中选择文件 2 并点击打开"按钮,则文件 1 被删除,只留下文件 2.
Currently, when the user selects file 1 from folder 1 then hits "Open", the selection window closes (leaving the user on my form). Then if the user goes and select file 2 from folder 2 and hits the "Open" button, file 1 is removed, leaving only file 2.
基本上,用户无法选择多个文件,除非它们都位于同一位置.选择文件 2 后,有没有办法让文件 1 保持选中状态?
Basically, the user is unable to select multiple files unless they're all in the same location. Is there a way to make file 1 stay selected after file 2 is chosen?
推荐答案
不,你不能.这是由操作系统定义的行为,并且可能因操作系统而异.你无法精确控制这些事情,你总是会害怕发生什么.
No, you can't. This is a behaviour defined by the operating systems and may vary between them. You can't control these things precisly and you will always fear what happen.
如果人们必须选择的文件夹数量非常少,您可以提供多个上传字段.
If the amount of folders people have to choose is quite small you could offer multiple upload fields.
这篇关于从不同文件夹上传 HTML 多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从不同文件夹上传 HTML 多个文件


基础教程推荐
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01