私はIIS7のRequest Limits <requestLimits>
の設定、具体的にはmaxAllowedContentLength
を見ていて、これがASP.NET Routingレベルに適用できるのだろうかと疑問に思っていましたか?私はファイルのアップロードを可能にするASP.NET MVC 3プロジェクトに取り組んでいますが、それらの特定のルートに対してのみ大きなリクエストを許可したいと考えています。IISが制限を要求できる<requestLimits maxAllowedContentLength = "x">特定のASP.NETルートに適用されますか?
に似てWhere do I catch and handle maxAllowedContentLength exceeded in IIS7?への答えは、私がこのような何かを行うことができ暗示しているようだが、私は確認または他のアイデアを探していました。
protected override void OnError(EventArgs e)
{
Exception err = Server.GetLastError();
if (err is HttpException)
{
if ((err as HttpException).WebEventCode == 3004)
{
// check to see if upload request and let through
Server.Transfer(Context.Request.Url.LocalPath);
return;
}
}
base.OnError(e);
}