複数ファイルをアップロードしようとした時に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
Bydefault,ASP.NETCoreallowsyoutouploadfilesapproximately28MBinsize.However,attimesyouwanttodeviatefromthislimitanduploadlargerfilesontheserver.Toraisethislimity...
maxRequestLengthを増やすといい、って話も見たけどこちらでは変化なし。
<configuration>
<system.web>
<httpRuntime maxRequestLength="2097152" />
</system.web>
</configuration>
IISの設定でuploadReadAheadSizeを上げるというのもあった。
2147483647(上限)まで上げてみたものの変化なし。

StackOverflowだとこの辺が類似の問題だと思います。
参考になればと思い、リンクを残しておきます。

(413) Request Entity Too Large | uploadReadAheadSize
I'vewrittenaWCFservicewith.NET4.0,whichishostedonmyWindows7x64UltimatesystemwithIIS7.5.Oneoftheservicemethodshasan'object'asargumentandI'mtryingtosendabyte[]wh....
コメント