简体   繁体   English

浏览并发布路径而不是文件

[英]Browse and post a path not the file

I've got a slightly unusual scenario. 我有一个稍微不寻常的情况。 A web app running on a local network can perform various operations on any file on the network it can access. 在本地网络上运行的Web应用程序可以对其可以访问的网络上的任何文件执行各种操作。 At present the user copies/pastes the UNC path to the file into a text input and clicks submit. 目前,用户将文件的UNC路径复制/粘贴到文本输入中,然后单击“提交”。

The server retrieves the file, performs some operations and returns the results to the user. 服务器检索文件,执行一些操作,然后将结果返回给用户。

I'd like to allow the user to browse for the file using the webpage - but I don't want to upload the file, just get the full path to it. 我想允许用户使用网页浏览文件-但我不想上传文件,只需获取文件的完整路径即可。 Is this possible? 这可能吗?

I'm aware there will be a couple of scenarios which are doomed to failure - eg browsing to a local path not a UNC share but I can cover this with some validation. 我知道会有几种情况注定会失败-例如,浏览到本地路径而不是UNC共享,但是我可以通过一些验证来解决这个问题。 There will also be scenarios when the server can access a path the user can't (this is intentional) so browsing wouldn't work here. 在某些情况下,服务器可以访问用户无法访问的路径(这是有意的),因此无法在此处进行浏览。

All users will be techies who should get the point. 所有用户都是应该理解这一点的技术人员。 Of course, if there were a way to limit the browse dialog to a UNC path, that would be even better but I suspect it's impossible. 当然,如果有一种方法可以将浏览对话框限制为UNC路径,那会更好,但我怀疑这是不可能的。

Note, we already limit support to the latest versions of the main browsers and since this is just a utility feature, limited support is acceptable. 请注意,我们已经限制了对主要浏览器的最新版本的支持,并且由于这只是实用程序功能,因此可以接受有限的支持。

Sorry, that can't be done. 抱歉,无法完成。 It's a security feature. 这是一项安全功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM