2016-09-23 9 views
0

WebサーバーにWebサイトをアップロードしました。私はアップロードしてファイルを削除するオプションがあります。私はテストの途中です。すべてがスムーズに進んでいます。私はファイルをアップロードしようとしました、私はそれを削除し、それは完全に動作します。私は既存のファイルを削除しようとしているときしかし、それはエラーがスローされます。Webサーバー内の既存ファイルを削除できません

An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

私はそれが権限とは何かを持っていることを知っていました。サイトを通じてアップロードしたファイルにあるアクセス許可を比較すると、.NET v4.5が表示されますが、既存のファイルにはそのようなユーザーは存在しません。私はそれを追加しようとしましたが、.NET v 4.5はありません。

私はNETWORK SERVICEを追加しようとしましたが、完全な許可を与えましたが運がまだありません。私はあなたがこの人に私を助けてくれることを願っています。

UPDATE:

ここでは、例外の詳細です:

System.UnauthorizedAccessException: Access to the path 'C:\"MyFilePath"' is denied. 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 , 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.

+0

例外の詳細を追加してください。 – Boney

+0

@Boney私は私の質問に例外の詳細を追加しました。どうもありがとうございます。 – moonlight04

+0

アプリケーションプールを実行するIDには、削除しようとしているファイルに対する削除権限が必要です。 サイトを実行するAppPoolのIDを教えてください。 AppPoolを「ASP.NET v4.0統合」に変更し、グループに「IIS_IUSRS」アクセス権を与えてください。 – Boney

答えて

0

アプリケーションプールを実行すると、削除しようとしているファイルの削除の権限を持っている必要があり、その下のアイデンティティ。
AppPoolを「ASP.NET v4.0統合」に変更し、グループに「IIS_IUSRS」アクセス権を与えてください。

+0

助けてくれてありがとう! :) – moonlight04

関連する問題