Upload/download large files with ASP.Net
One of the most frequent support questions I encounter pertains to problems uploading or downloading large files using ASP.net. Assuming that these aren’t super-huge files so we do not have to go into details of ASP.net’s inherent inefficiencies in this area, there is usually one reason for the problem — incorrect configuration in the web.config file.
In order to support large file uploads, ASP.net needs to be told to increase the “maxRequestLength” attribute of the “httpRuntime” element to a number larger than 4096 (Kb) which is the default.
Both uploads and downloads will fail if the “executionTimeout” attribute (also of the “httpRuntime” element) is at the default of 90 seconds. What number you set this to depends entirely on the size of the uploads/downloads the application must support and the expected bandwidth of the user.
Here’s the MSDN reference for httpRuntime.