要求の長さの最大値を超えました

ASP.NET MVC にてファイルアップロード機能を実装中に「要求の長さの最大値を超えました。」エラーに遭遇
Web.configの設定だなーとすぐわかったけど、どこに入れるか忘れていたのでメモがわりに(^_-)-☆
system.webのhttpRuntimeにmaxRequestLengthを設定
以下の通りです。プロジェクトによって構造は違うと思いますが、httpRuntimeにmaxRequestLengthを設定してあげれば問題なしです。
<system.web>
<!--<authentication mode="None" />-->
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
<customErrors mode="Off"/>
<compilation targetFramework="4.5.2" debug="true"/>
<httpRuntime targetFramework="4.5.2" maxRequestLength="5120"/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>
0 件のコメント:
コメントを投稿