title: MVC3 Action File Size Limit
body: <p>I'm implementing a jquery based file upload plugin <a href="http://blueimp.github.com/jQuery-File-Upload/" rel="nofollow noreferrer">http://blueimp.github.com/jQuery-File-Upload/</a>. There is a sample MVC3 app that you can download <a href="https://github.com/maxpavlov/jQuery-File-Upload.MVC3" rel="nofollow noreferrer">https://github.com/maxpavlov/jQuery-File-Upload.MVC3</a>.</p>
  
  <p>The author of the sample has a comment in the Home View:
  </p>
  
  <blockquote>
    <p>@*IN ORDER TO USE MVC ACTIONS AS HANDLERS OF AJAX CALLS, USE THE FORM DECLARATION BELOW. (THE ONE COMMENTED OUT)
    IT IS NOT ADVISED SINCE WHEN USING MVC CONTROLLER TO HANDLE REQUESTS ONE CAN'T CONTROL THE maxMessageLength OF THE POST REQUEST
    THIS CASTS THE FUNCTIONALITY OF UPLOADING LARGE FILES USELESS, UNLESS YOU SUCRIFICE THE SECURITY AND ALLOW LARGE 
    POST MESSAGE SIZES SITE-WIDE.</p>
    
    <p>IT IS BETTER TO USE HTTP HANDLER TO PROCESS UPLOAD REQUESTS UNTIL MVC FRAMEWORK PROVIDES WAYS TO SET maxMessageLength ON
    PER ACTION BASIS *@</p>
  </blockquote>
  
  <p>Is this still the case?</p>
  
  <p>I've found out I can set the <code>&lt;httpRuntime maxRequestLength="x" /&gt;</code> in the web.config, but my understanding is that this is a security vulnerability. Is the case also?</p>
  
  <p>I would prefer to handle my upload in the controller instead of using an HttpHandler but don't want to be limited by file size and don't want to introduce any security vulnerabilities if I don't have to.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>According to this post <a href="https://stackoverflow.com/questions/5193842/file-upload-asp-net-mvc3-0">File Upload ASP.NET MVC 3.0</a> the default file size limit is 4mb. I've confirmed this limit <a href="http://msdn.microsoft.com/en-us/library/e1f13641.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/e1f13641.aspx</a> and understand the vulnerability. </p>
  
  <p><strong>Is this the only way to upload a file thru a controller action beyond 4mb?</strong></p>