File-Upload via local file path

♀尐吖头ヾ 提交于 2019-12-11 07:02:01

问题


Is there a way for enabling file upload via file path?

The default HTML file upload control displays a disabled textbox and a button. Is it possible via JS or something to upload a file when the user pastes the path to the file into a textbox?

This webpage is within a corporate intranet.


回答1:


No, such thing is not possible in web application using ordinary HTML/JavaScript - period.

The one and only way for user to choose file is via the file dialog opened by clicking the browse button of the <input type="file" /> element.

The only shortcut possible is that JS can open the file dialog automatically, but still - that's the only way for user to choose what file to upload.




回答2:


There are some small possibilities to do that within a trusted network. Not exactly the same, but still a very similar question: Local file access with javascript



来源:https://stackoverflow.com/questions/6582685/file-upload-via-local-file-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!