简体   繁体   English

通过ASP网站访问VFS共享网络驱动器并查看其中的文件,可能是IIS错误

[英]Accessing a VFS shared network Drive through ASP Website and Viewing the files inside, Possible IIS fault

I have an ASP.NET website, that has to access a shared network drive. 我有一个ASP.NET网站,该网站必须访问共享的网络驱动器。 The shared network drive is on an EMC path or ECS. 共享网络驱动器位于EMC路径或ECS上。 The management module for the shared drives is EMC made, accessible through a browser, so I am assuming. 我假设共享驱动器的管理模块是EMC制造的,可以通过浏览器访问。

In the web.config, I have the drive names as Z:, R: etc.. 在web.config中,我的驱动器名称为Z:,R:等。

I am able to mount them on the cmd line with the following line. 我可以使用以下行将它们安装在cmd行上。 Otherwise, there is no windows access to VFS folder through the address bar or a browser. 否则,将无法通过地址栏或浏览器通过Windows访问VFS文件夹。

mount -o xx.xx.xx.xx://vfs/folder_I_need_to_Access_to. Z:

I have modified the program's code, mounted the drives and am able to access the files while debugging the code, in the web browser. 我已经在Web浏览器中修改了程序的代码,安装了驱动器,并能够在调试代码的同时访问文件。 However, once I publish my code to the IIS server, the code does not seem to access the files and view them, even though the drive is mounted as a network drive and accessible through windows explorer. 但是,一旦我将代码发布到IIS服务器,即使驱动器安装为网络驱动器并可以通过Windows资源管理器访问,该代码似乎也无法访问文件并查看它们。 I have checked permissions on both EMC manager, Windows and IIS. 我已经检查了EMC Manager,Windows和IIS的权限。

Some of my distant colleagues have said their teams ran into such issues and fixed them, however they have no idea what to do since they do not usually have logs or bugfixing documents, so I am assuming, mine is not an isolated case. 我的一些遥远的同事说他们的团队遇到了此类问题并解决了这些问题,但是他们不知道该怎么办,因为他们通常没有日志或错误修正文档,所以我认为,我的情况并非孤立。

If you need more info on the subject, feel free to ask, I have scoured the internet and applied every solution by the way. 如果您需要有关此主题的更多信息,请随时询问,我已经在互联网上进行搜索并顺便应用了每种解决方案。 Like NekoDrive, network utility libraries, among other questions on StackOverflow. 像NekoDrive一样,网络实用程序库以及有关StackOverflow的其他问题。

EDIT : adding the network folders to IIS as virtual directories does not work as well, however, I am able to access the files and folders through IIS manager content view, so I assume IIS is able to scan the directories and has appropriate permissions to the folders. 编辑:将网络文件夹作为虚拟目录添加到IIS效果不佳,但是,我能够通过IIS管理器内容视图访问文件和文件夹,因此,我认为IIS能够扫描目录并且对IIS具有适当的权限文件夹。 Also, the user running the website is a domain admin and able to access directories as well. 同样,运行网站的用户是域管理员,并且也可以访问目录。

tldr; tldr; The program deployed on IIS cant access the network shared folders under a vfs directory, while its owner and the debugged code on localhost is able to. 部署在IIS上的程序无法访问vfs目录下的网络共享文件夹,而其所有者和localhost上的调试代码则可以。

I have finally solved the issue. 我终于解决了这个问题。

In case anyone else stumbles here, 万一有人在这里绊倒,

Since mounting the drives was impossible, I have modified the web.config to have the IP address instead of the mounted drive's letter in IIS manager, Configuration Editor. 由于无法安装驱动器,因此我修改了web.config,使其具有IP地址,而不是在IIS管理器“配置编辑器”中安装的驱动器号。

So instead of Z:\\ , K:\\ or F:\\ 因此,代替Z:\\,K:\\或F:\\

now it says; 现在它说:

\\XX.XX.XX.XX\VFS\SHARED_FOLDER

and the download link is generated as follows, take note of the backslash and slashes 并按如下所示生成下载链接,请注意反斜杠和斜杠

\\XX.XX.XX.XX\VFS\SHARED_FOLDER\file_path/file_path/file_name

Because it would clearly show the IP of the machine while the download link is hovered on, I am encrypting and decrypting the link variable during runtime. 因为在悬停下载链接时,它可以清楚地显示机器的IP,所以我在运行时对链接变量进行加密和解密。

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

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