从文件对话框中的URL浏览文件 [英] Browse File from url in file dialog box
问题描述
大家好,
我正在尝试将文件上传到服务器,问题是,我必须允许用户选择一个文件共享位置。
我可以打开带有默认位置pointint的文件对话框到我的文件所在的URL吗?
我正在构建的系统是一个接口。第一个系统将输出文件放在共享点上。
在我的系统中,用户浏览共享点并选择相关文件并上传。 br />
这里我处理文件并将数据发送到下一个系统。
希望现在这个很清楚。
谢谢,
Manognya。
Hi All,
I am trying to upload a file to server and the problem is, I have to allow the user to select the file which is on a shared location.
Can i open the file dialog with a default location pointint to that URL where my files are present?
The system i am building is an interface.The first system puts the output file on share point.
In my system, user browses through share point and chooses relevant files and uploads.
Here i process the files and send the data to the next system.
Hope this is clear now.
Thanks,
Manognya.
推荐答案
只是为了做到这一点很清楚,因为你可以从评论中看到一些混乱。当然,即使是最简单的上传形式也会显示对话框:
Just to make it clear, because there is some confusion you can see from comment. Of course the dialog is shown even in the simplest form of upload:
<form method="post" ...>
<!- ... ->
<input type="file" name="img">
<!- ... ->
</form>
在这种情况下,名称img将用于从服务器端的HTTP请求中检索文件。
如果用户点击一个小按钮,通常是从输入字段开始,类似[...],将显示浏览器对话框。
基本上,这就是你能做的一切做。但是默认目录的问题不仅无法解决,它根本没有意义。您不仅无法控制客户端站点;你所做的只是Web应用程序。它不知道有关客户端系统的任何信息。这一次是另一次,这是另一回事。什么默认?请稍微考虑一下。
但是,实际上可以在每个客户端系统上存储最后访问的目录。但是,如果这是一个标准功能,那么干扰文件浏览器的工作是可能的。只有这样才能在所有平台和浏览器上使用。但是,据我所知,没有这样的事情。我会说,这是有充分理由的。毕竟,用户不是白痴;她或他应该知道本地文件在哪里。
同时,它会发生,无需你在某些浏览器上的任何努力,并赢了不会发生在别人身上。 这只是每个特定浏览器的实现细节。
这篇关于从文件对话框中的URL浏览文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!