[英]how to grant write permissions to an web api application in IIS?
I simply have a web api application on IIS server that simply writes to text file on C:\\FileStorage\\test.txt however when I call this webservice I get the internal 500 error, after expanding the error,I get the following error, how do I grant write access to this web service on IIS server? 我只是在IIS服务器上有一个web api应用程序,它只是写入C:\\ FileStorage \\ test.txt上的文本文件,但是当我调用这个web服务时,我得到内部500错误,在扩展错误后,我得到以下错误,如何在IIS服务器上授予对此Web服务的写访问权限?
"ExceptionMessage": "Access to the path 'C:\\FileStorage\\test.txt' is denied.",
"ExceptionType": "System.UnauthorizedAccessException",
"StackTrace": " at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at
Grant permissions for that folder to the application pool. 将该文件夹的权限授予应用程序池。 So you'd go to the C:\\FileStorage folder in Windows and edit permissions, and add IIS APPPOOL\\appPoolNameHere as a user, then give it full permissions.
因此,您将转到Windows中的C:\\ FileStorage文件夹并编辑权限,并以用户身份添加IIS APPPOOL \\ appPoolNameHere,然后为其授予完全权限。
Hope that helps. 希望有所帮助。
EDIT 编辑
Step by Step Instructions... 分步说明......
-Open Windows Explorer - 打开Windows资源管理器
-Browse to your folder - 浏览到您的文件夹
-Right click the folder and go to Properties - 右键单击该文件夹,然后转到“属性”
-On the Security tab click Edit - 在“安全”选项卡上单击“编辑”
-Click Add - 点击添加
-Under Locations, make sure it is pointing at your local machine, not a domain - 在“位置”下,确保它指向本地计算机,而不是域
-For the object name, enter below but replace MyAppPool with the name of your application pool... - 对于对象名称,请在下面输入,但将MyAppPool替换为应用程序池的名称...
IIS APPPOOL\\MyAppPool IIS APPPOOL \\ MyAppPool
-Set the permissions to Full, or just add Write, or whatever you need. - 将权限设置为“完全”,或者只添加“写”或任何您需要的权限。
or you can repalce APPPOOL to the name of your server or computer and with the IIS_ISURS
. 或者您可以使用IIS_ISURS将APPPOOL重新命名为您的服务器或计算机的
IIS_ISURS
。 example: 例:
yourserver\IIS_IUSRS
See this Screen Shot 看这个屏幕截图
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.