访问被拒绝的服务器 [英] Access To Sever Denied

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

问题描述

大家好,我有一个网页,只允许登录用户写入服务器上的文件。当我尝试通过单击保存按钮写入服务器上的文件时,出现以下错误

Hi all, I have a web page which allows only logged in users to write to a file on the server. When I try to write to a file on the server by clicking the Save button, I get the following error

Access to the path 'G:\PleskVhosts\MySite.com\httpdocs\images\Five.png' is denied.



错误消息还说明以下


The error message also said the following

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity.



我正在使用表单身份验证,我尝试实现模拟,但它不起作用。任何人都可以告诉我如何授权访问服务器上的资源,提前谢谢。


I am using Form authentication and I've tried to implement impersonation but it did not work. Can anyone please tell me how to grant access to resources on the server, thanks in advance.

推荐答案

提供文件夹和文件的完全访问权限。

转到你的FTP控制面板并更改文件夹/目录权限。

否则你与服务提供商分享你的问题然后说给我文件夹保存文件的权限。
Provide full Access of folder as well as files .
go your FTP Control Panel and change folder/Directory Permission .
otherwise you share your problem with service provider And say give me file Permission for save in a folder .


为窗口的登录用户提供该文件夹的完全访问权限。
provide full access on that folder for login user of window.


首先不要在服务器中使用任何随机驱动器,因为将来你可能无法访问。因此,在服务器上使用特定于用户的路径,永远不会抛出错误。



使用以下代码进行任何类型的文件操作。

First of all don't use any random drive in server as in future you may not have access to that. So use user specific path on the server which would never throw an error.

Use below code for any kind of manipulation of files.
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);





始终使用此路径保存和访问文件。



Always use this path for saving and accessing files.


这篇关于访问被拒绝的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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