File upload problem

whenever I upload an attempt to download a file with a size larger than the size specified in maxRequestLength, the browser shows that "the web page could not be rendered". someone please tell me how to fix this problem.

+2


a source to share


2 answers


Increase the maxRequestLength

value in your file web.config

.

maxRequestLength

indicates the maximum file upload size supported by ASP.NET. This limit can be used to prevent denial of service attacks caused by users sending large files to the server. The specified size is in kilobytes. The default is 4096 KB (4 MB).

See maxRequestLength on MSDN.



So if, for example, the page you published is this Upload.aspx

, the section you need in web.config

will be like this

<location path="Upload.aspx">
    <system.web>
        <httpRuntime maxRequestLength="{your value here}" 
                     executionTimeout="{your value here}" />
    </system.web>
</location>

      

+2


a source


Put this in your web.config

  <system.web>
     <httpRuntime executionTimeout="360" maxRequestLength="100000" />

      

This allows you to get a 360 second timeout and 100,000KB of download data at a time.



If that doesn't work, run this command on your IIS server. (replace [IISWebsitename])

C:\Windows\System32\inetsrv>appcmd set config "[IISWebsitename]" -section:requestFiltering -requestLimits.maxAllowedContentLength:100000000 -commitpath:apphost

      

This allows you to download 100,000,000 bytes at a time.

0


a source







All Articles