Upload file problem in ASP.NET mvc

0

Uploading files through FileUpload has a maximum size of 4 MB, after searching I found here in stackoverflow that should add:

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

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

The problem is that the site runs if I add this information, but I have the same error, how could I solve this problem? I thank you

    
asked by anonymous 01.11.2016 / 03:20

1 answer

2

The problem of the site not to run was to repeat the httpRuntime that is automatically created inside the system.web like this:

<httpRuntime targetFramework="4.5" />

To solve, I commented, it looks beautiful and I added:

 <!---tamanho do arquivo-->
    <httpRuntime maxRequestLength="1048576" />

I've also added:

 <!--tamanho do arquivo-->
  <security>
    <requestFiltering>
        <requestLimits maxAllowedContentLength="1073741824" />
    </requestFiltering>
  </security>

Now I can upload a file with a larger size

    
01.11.2016 / 03:46