gpt4 book ai didi

c# - 系统.UnauthorizedAccessException : Access to the path denied error

转载 作者:太空宇宙 更新时间:2023-11-03 21:50:22 25 4
gpt4 key购买 nike

我正在使用第 3 方服务器,我正在尝试从我用 c# mvc 制作的 Web 表单将图像上传到服务器。它在我的本地主机上运行良好,当我发布它时它给我一个错误

System.UnauthorizedAccessException: Access to the path 'D:\InetPub\vhosts\abc.com\httpdocs\Images\Sections\Developer\ClientLogo\circle-small-empty.18x18.png' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at System.Web.HttpPostedFileWrapper.SaveAs(String filename) at ab.CorporateSite.Controllers.DeveloperController.ImagePath(HttpPostedFileBase imgfile).

通过 filezilla,我检查了服务器上我想保存图像的特定文件夹(ClientLogo 文件夹)的权限,acc。它拥有全部权利,在我的本地系统上,我也赋予了网络服务和所有人全部权利。

我从昨天开始就在为这个问题苦苦挣扎,但没有任何效果。请建议我该怎么做??

最佳答案

您需要为 IIS application pool identity 授予对文件夹的权限您的应用程序正在其下运行。

需要权限的虚拟用户通常是 IIS AppPool\AppPoolNameGoesHere

关于c# - 系统.UnauthorizedAccessException : Access to the path denied error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14862256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com