IIS Virtual Directory map to network drive (with drive letter) but fail to create file

你。 提交于 2019-11-29 04:49:00

Mapped network drives are specific to the user account that created them:

Using Mapped Drives with IIS - MS KB257174

The preferred method of accessing content for the Web server that exists on a remote computer is to use shares that follow the universal naming convention (UNC).

It's very likely that NETWORK SERVICE (or if you're running ASP.NET under impersonation, the site anonymous account) hasn't got this mapping.

To change the location where the virtual directory points to, browse to your site in IIS manager, right click on the virtual directory and select properties. You can then select "A share located on another computer":

The website in IIS has a corresponding app pool and this should tell you the user under which your code wil be running. You'll the have to grant the appropriate permissions for that share for that user.

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