Search

Tuesday, January 28, 2014
2 comments

The transfer fails if a user tries to upload a file in ASP.NET

7:03 AMTuesday, January 28, 2014
Size restriction protects your web application from malicious users. They will upload numerous large files to your Web server. So Developers take the default size limitation is 4MB. The transfer fails if a user tries to upload a file that is larger then 4096kb. Now, if you want to change the default size limitation, you make some changes in either the root we.config file , which is found in that path (c:\Windows\Microsoft.NET\Framework\v4.0.xx\config) or in your application's web.config file.

How to Increase uploaded file size 

<httpRuntime> section takes different properties but two properties , The maxRequestLength and executionTimeout properties are very nice. If you want to change the default uploaded file size then you must to change the value of maxrequestLength. It take the size in KiloBytes. Lets take a simple syntax here.

maxRequestLength= 11000

The user can upload around 10mb files using file upload control. Also must to change the executionTimeout property, This property sets the time ( in seconds ) for a request to attempt to execute to the server before ASP.NET shuts down the request. try this into your web.config file

<system.web>
    <httpRuntime executionTimeout ="300" maxRequestLength ="11000"/>
</system.web>
Protected by Copyscape Online Copyright Protection Software

2 comments :

  1. The maxRequestLength and executionTimeout properties are very nice. online earning tutorial urdu video

    ReplyDelete
  2. Size restriction protects your web application from malicious users. They will upload numerous large files to your Web server.seo urdu video tutorials

    ReplyDelete

 
Toggle Footer
Top