複数ファイルをアップロードしようとした時に413Errorが出たので覚書。
単発のファイルや小さいファイルはOKで、ある程度のサイズ(30MBくらい?)以上のファイルを送るとエラーが出る。
Web.ConfigのmaxAllowedContentLengthを伸ばしてやれば解消。
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="209715200" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
参考になったのはこちらのサイト
Upload Large Files in ASP.NET Core | BinaryIntellect Knowledge Base
By default, ASP.NET Core allows you to upload files approximately 28 MB in size. However, at times you want to deviate from this limit and upload larger files o...
maxRequestLengthを増やすといい、って話も見たけどこちらでは変化なし。
<configuration>
<system.web>
<httpRuntime maxRequestLength="2097152" />
</system.web>
</configuration>
IISの設定でuploadReadAheadSizeを上げるというのもあった。
2147483647(上限)まで上げてみたものの変化なし。

StackOverflowだとこの辺が類似の問題だと思います。
参考になればと思い、リンクを残しておきます。
(413) Request Entity Too Large | uploadReadAheadSize
I've written a WCF service with .NET 4.0, which is hosted on my Windows 7 x64 Ultimate system with IIS 7.5.
One of the service methods has an 'object' as argume...
コメント