无法访问该路径.请帮助... [英] Access to the path denied.. Pls help...

查看:60
本文介绍了无法访问该路径.请帮助...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Whnevr我尝试使用浏览器上载文件,但出现以下错误..请帮助..我不喜欢asp.net帐户bt的特权较低的原因,如何解决此问题...

Whnevr i try to upload a file using ma browser i get the following error.. Please help.. I noe its coz of low privileges of asp.net account bt how to resolve the problem...

Server Error in ''/Translator'' Application.
Access to the path ''E:\My Documents\Visual Studio 2008\Translator\App_Data'' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.UnauthorizedAccessException: Access to the path ''E:\My Documents\Visual Studio 2008\Translator\App_Data'' is denied. 
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error: 

Line 76:     protected void Button2_Click(object sender, EventArgs e)
Line 77:     {
Line 78:         FileUpload1.SaveAs(Server.MapPath("App_Data"));
Line 79:     }
Line 80: }
Source File: e:\My Documents\Visual Studio 2008\Translator\Default.aspx.cs    Line: 78 

推荐答案

添加到上面:
将文件上载到服务器时,需要对要在用于上载文件的目录上处理该请求的帐户具有适当的写许可权.

检查MSDN链接-文件上传控件安全注意事项部分 [^ ]

向用户(通常为ASPNET用户)或模拟呼叫的用户帐户提供写权限.
Adding to above:
When you are uploading a file to the server, you need to have appropriate write permission to the account processing the request on the directory that you are using to upload the file.

Check the MSDN link - FileUpload Control Security Considerations section[^]

Either provide the write permission to the user (generally ASPNET user) or to the user account that is impersonating the calls.


您可以通过授予应用程序池标识写权限和创建权限来解决此问题.在App_Data上.就像错误消息中指出的那样,偶然.
You can resolve the problem by granting the application pool identity write and create permissions on App_Data. Just like the error message states, incidentally.


阅读您在问题中发布的内容会有所帮助:

Reading what you posted in your question would help:

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:



现在,您不了解其中的哪一部分?

最好的问候,

-MRB



Now which part of that do you not understand?

Best Regards,

-MRB


这篇关于无法访问该路径.请帮助...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆