开发者

Please help me to upload image file to my site in asp.net-vb error

开发者 https://www.devze.com 2023-03-08 09:52 出处:网络
i want upload file to 开发者_如何转开发my site but give a error message Access to the path \'C:\\hshome\\jahanmap\\jahanmap.com\\default\\tatlises-rop.jpg\' is denied.

i want upload file to 开发者_如何转开发my site but give a error message Access to the path 'C:\hshome\jahanmap\jahanmap.com\default\tatlises-rop.jpg' 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 'C:\hshome\jahanmap\jahanmap.com\default\tatlises-rop.jpg' 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 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , 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 67: ' save the image
Line 68: saveFile = Path.Combine(savePath, FileUpload1.FileName)
Line 69: FileUpload1.SaveAs(saveFile)
Line 70: 
Line 71: ' for product images we also create a thumbnail


The error message in your question gives you all the information you need - you need to give your ASP.NET account write access to the folder you are trying to access - the error message tells you exactly how to do this.


It seems you don't have access right to the path. You need to change the access right and then test again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号