Ajax post request has more than 4 MB of file

I am developing an MVC 4 application. I am sending ajax post request to a controller action. When the post data is greater than 4 MB, the action request fails. What's the solution for this?

+1


source to share


2 answers


You need to change two config options (the value is in KB)

In Web.Config

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="8192" />
  </system.web>
</configuration>

      



In IIS

Update the "Maximum Allowed Content" setting as described here: http://ajaxuploader.com/large-file-upload-iis-asp-net.htm

+2


source


You can try to expand the size of one of these properties.

<system.web> 
    <httpRuntime maxRequestLength="x" />


<system.webServer> 
  <security> 
    <requestFiltering> 
      <requestLimits maxAllowedContentLength="x" ></requestLimits>

      



Set x

to the desired size. Read this post

for reference.

+2


source







All Articles