Uncategorized

Upload/download large files with ASP.Net

September 3, 2004

author:

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.

Founder NftyDreams; founder Decentology; co-founder DNN Software; educator; Open Source proponent; Microsoft MVP; tech geek; creative thinker; husband; dad. Personal blog: http://www.kalyani.com. Twitter: @techbubble
Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.