0

Web サイトで ASP.Net 4.5 と認証を使用しており、管理者専用の管理者フォルダーがありますが、管理者がログインして画像をアップロードすると、ページ エラーは次のようになります。

Access to the path 'C:\Inetpub\...\secdescimg\65ed367d-9526-4b14-842c-4e10c2845d03.jpg' is denied.  

「secdescimg」このフォルダーは管理フォルダーになく、アップロードはユーザー制御であり、両方をドラッグして管理フォルダーに移動しましたが、このエラーが再び発生します。

4

1 に答える 1

2

Right-Click the folder, go to Properties, Security tab, make sure the local ASPNET account has Read and Write permissions on that folder. If not, Add local ASPNET account to the list and give it read and write permissions. Click OK.

アップデート:

It's beacause the problem is that ASPNET user or NETWORK SERVICE user (both are user accounts on the server, which ASPNET uses to authorize for the OS) need to have permissions to write the file to aforementioned location.

Account need the permissions to the folder where file is written (the file isn't there before uploading, of course), so user of course doesn't set any permissions to anywhere but server admninistrator does to 'D:\inetpub\mywebfolder\subfoldername dir in this case (I might suggest specifying a location outside web folders in case they are not supposed to be downloaded just like that)

Writing something is stronger permission than just reading so, admin needs to give the write permission in order to enable file uploading if you want to save it straight to server's hard disk.

于 2013-09-23T09:24:41.640 に答える