Problem with File Upload to Asp.net mvc

Asked

Viewed 58 times

0

Upload 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, plus I have the same error, how could I solve this problem? thank you

1 answer

2

The problem of the site not running was the fact of repeating httpRuntime which is created automatically within the system.web in this way:

<httpRuntime targetFramework="4.5" />

To resolve I commented is beautiful and added:

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

I also added:

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

Now I can upload file with larger size

Browser other questions tagged

You are not signed in. Login or sign up in order to post.