文件上传远程服务器上的问题 [英] File Uploading Problem on remote server

查看:89
本文介绍了文件上传远程服务器上的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该从代码后面设置任何许可吗

请有人帮忙...

should i set any permission from code behind
please someone help...

picupload.SaveAs(server_path);



我正在尝试上传/保存图片/文件

抛出此错误




while i am trying to upload/save the image/file
this error is thrown

Access to the path 'D:\INETPUB\VHOSTS\softmarvel.com\site1\Member_Pic\12.png' 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 'D:\INETPUB\VHOSTS\softmarvel.com\site1\Member_Pic\12.png' 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 <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.

推荐答案

阅读错误消息的最后一段。

错误是由访问权限引起的,您无权使用该资源或Image(在本例中)。

有关此异常的更多信息:UututhorizedAccessException [ ^ ]
Read the Last paragraph of your error Message.
The error is due to the access rights, You are not authorized to use that resource or Image(in this case).
More Information about this exception: UnauthorizedAccessException[^]






此错误是因为访问该特定文件夹。



这将对您有所帮助:http://technet.microsoft.com/en-us/library/cc730708(WS.10).aspx [ ^ ]


if (FileUpload1.HasFile)
           {

               FileUpload1.PostedFile.SaveAs("Your  Location Path");
           }







你可以用它和它工作







如果您的问题存在请给我你的评论




You Can used It And It Works



If Your Problem Exist Please Give me Your Comment


这篇关于文件上传远程服务器上的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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