文件上传通过本地文件路径 [英] File-Upload via local file path

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

问题描述

有没有办法通过文件路径启用文件上传?



默认的HTML文件上传控件显示禁用的文本框和按钮。当用户将文件的路径粘贴到文本框中时,是否可以通过JS或其他方式上传文件?



该网页位于企业内部网中。

解决方案

不,在使用普通HTML / JavaScript期间的Web应用程序中,这种事情是不可能的。



用户选择文件的唯一方式是通过单击< input type =file/> 元素。



唯一可能的捷径是JS可以自动打开文件对话框,但仍然是用户选择要上传文件的唯一方法。 / p>

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.

解决方案

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.

这篇关于文件上传通过本地文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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