網(wǎng)站上傳文件提示這個錯誤怎么解決

“/”應(yīng)用程序中的服務(wù)器錯誤。

對路徑“C:\inetpub\wwwroot\UploadFiles\2025\02\”的訪問被拒絕。

說明: 執(zhí)行當(dāng)前 Web 請求期間,出現(xiàn)未處理的異常。請檢查堆棧跟蹤信息,以了解有關(guān)該錯誤以及代碼中導(dǎo)致錯誤的出處的詳細(xì)信息。

異常詳細(xì)信息: System.UnauthorizedAccessException: 對路徑“C:\inetpub\wwwroot\UploadFiles\2025\02\”的訪問被拒絕。

ASP.NET 未被授權(quán)訪問所請求的資源。請考慮授予 ASP.NET 請求標(biāo)識訪問此資源的權(quán)限。ASP.NET 有一個在應(yīng)用程序沒有模擬時使用的基進程標(biāo)識(通常,在 IIS 5 上為 {MACHINE}\ASPNET,在 IIS 6 上為網(wǎng)絡(luò)服務(wù))。如果應(yīng)用程序正在通過 模擬,則標(biāo)識將為匿名用戶(通常為 IUSR_MACHINENAME)或經(jīng)過身份驗證的請求用戶。

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.

源錯誤:

執(zhí)行當(dāng)前 Web 請求期間生成了未處理的異常。可以使用下面的異常堆棧跟蹤信息確定有關(guān)異常原因和發(fā)生位置的信息。


堆棧跟蹤:

[UnauthorizedAccessException: 對路徑“C:\inetpub\wwwroot\UploadFiles\2025\02\”的訪問被拒絕。]    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +7942679    System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity) +7790121    System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity) +150    System.IO.Directory.CreateDirectory(String path) +6    SkyCenter.WebUI.ContentManage.Skins.Default.CMSAttachment.UploadFile.btnUpload_Click(Object sender, EventArgs e) +456    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


匿名 |9小時前 | 瀏覽 12 次

登錄后才能回答問題哦~ 點擊登錄

其他回答

首頁定制-中供問答
熱門商鋪排行榜
  • 信用達人
  • 熱榜先鋒
  • 活躍牛商
  • 新起之秀

更多商鋪 >