2011-12-21 33 views
1

私はIIS7のRequest Limits <requestLimits>の設定、具体的にはmaxAllowedContentLengthを見ていて、これがASP.NET Routingレベルに適用できるのだろうかと疑問に思っていましたか?私はファイルのアップロードを可能にするASP.NET MVC 3プロジェクトに取り組んでいますが、それらの特定のルートに対してのみ大きなリクエストを許可したいと考えています。IISが制限を要求できる<requestLimits maxAllowedContentLength = "x">特定のASP.NETルートに適用されますか?

この質問は未回答Can I increase maxRequestLength of ASP.NET request for MVC Controller Action with additional parameters?

に似て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); 
} 

答えて

1

あなたはそのルートに対応する(偽の)仮想ディレクトリの<location>タグに<requestLimits>要素を入れることができます。

私はこれ以上の解決策を知りません。

関連する問題