在godaddy Web服务器上的文件夹中上传图像时出错 [英] Error on uploading image in folder on godaddy web server

查看:101
本文介绍了在godaddy Web服务器上的文件夹中上传图像时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。 ASP.NET具有基本进程标识(IIS 5上通常为{MACHINE} \ ASPNET,IIS 6和IIS 7上为网络服务,IIS 7.5上已配置的应用程序池标识),如果应用程序未模拟,则使用该标识。如果应用程序通过< identity impersonate =true/>模拟,则身份将是匿名用户(通常是IUSR_MACHINENAME)或经过身份验证的请求用户。



要授予对文件的ASP.NET访问权限,请在文件资源管理器中右键单击该文件,选择属性,然后选择安全选项卡。单击添加以添加适当的用户或组。突出显示ASP.NET帐户,并选中所需访问的框。



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 File 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 26:         string filename = Path.GetFileName(fileuploadimages.PostedFile.FileName);
Line 27:         //Save images into Images folder
Line 28:         fileuploadimages.SaveAs(Server.MapPath("../CollegePics/" + filename));
Line 29:         //Getting dbconnection from web.config connectionstring
Line 30:         SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["hdcon"].ToString());

推荐答案

查阅GoDaddy文档,了解如何使文件夹可写,或者联系GoDaddy支持并询问他们,毕竟你付钱给他们。
Consult the GoDaddy documentation regarding how you make your folder writable, or contact GoDaddy support and ask them, you're paying them after all.


错误似乎与文件上传有关,文件夹'CollegePics'没有足够的权限上传文件



这可能会有所帮助 -

设置目录权限(Windows) [ ^ ]

文件上传权限被拒绝Godaddy共享主机 [ ^ ]



如果没有,您应该询问您的托管服务提供商(godaddy)的访问权限解决您的问题
The error seems to be related with file upload and the folder 'CollegePics' does not have the sufficient access to upload files

This may help -
Set Directory Permissions (Windows)[^]
File Upload Permission denied Godaddy Shared hosting[^]

You should ask your hosting provider(godaddy) for access permissions if it doesn't solve your problem


您好,



您只需要求您的托管服务提供商为您提供许可。据我所知他们使用Plesk Panel。您也可以通过控制面板设置权限 - >文件管理器 - >请参阅挂锁按钮 - >然后你可以给予许可。
Hi there,

You just need to ask your hosting provider to give the permission for you. As I know they use Plesk Panel. You can also set the permission via your control panel--> file manager--> see padlock button--> then you can give the permission.


这篇关于在godaddy Web服务器上的文件夹中上传图像时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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