HTML 输入=“文件”仅接受来自某些路径的
我有一个网页,允许通过基本 上传文件 我知道使用 javascript 无法在选择后获取完整路径,但是..一种仅从某些路径接受文件的方法,就像我对扩展名(*.jpg 等)所做的那样?
我处于 Windows 系统 Intranet 场景中,出于安全问题,我必须上传的文件无法从任何文件夹上传,只能从包含管理员编写和授权的只读文件的网络共享上传。
提前致谢
I have a web page that allow to upload a file via the basic <input type=file />
I know that with javascript there's no way to get the full path after selection but .. is there a way to ACCEPT files only from certain paths, as I do with extensions (*.jpg, etc)?
I'm in a Windows systems intranet scenario and for security issues, the file I have to upload cannot be uploaded from any folder but only from a network share that contains read-only files written and authorized by administrators
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不。即使有,您将如何为 Windows/Mac/Linux 系统指定这些路径。网络附加卷怎么样?您只能“建议”mime 类型/扩展名,文件对话框 100% 由用户决定。
No. And even if there was, how would you specify those paths for Windows/Mac/Linux systems. What about network attached volumes? You can only "suggest" mime-types/extensions and the file dialog is 100% up to the user.
不。这不是浏览器提供的功能。
它在 WWW 上下文中也没有多大意义,因为本地文件路径是针对不同系统定制的。
No. That is not a feature that browsers provide.
Nor would it be one that makes much sense in the context of the WWW as local file paths are custom to different systems.