Background
Out of the box asp.net restricts the size of file uploads. This is a security measure designed to stop attacks where hackers can overwhelm a website by uploading lots of large files, causing resource exhaustion (either RAM or diskspace typically). The default maximum file size if 4MB (4096k), and if a user uploads a file larger than this, they'll get an error message stating "Maximum request length exceeded."
It's possible to edit the machine.config to change this default for the entire machine, but the value can also be overriden in individual web.config files, so if you need to change it to a larger value, that is the recommended approach.
Filesize
In DotNetNuke, the default value has already been increased to 8MB for uploads. If you look in the default web.config file you'll see it looking like this :
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" requestLengthDiskThreshold="8192" />
To alter this for a larger value, you first have to calculate what value you will need in KiloBytes e.g. 1 megabyte=1024K, so if you need to support 10MB uploads, you'll alter this to 10240
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="10240" requestLengthDiskThreshold="10240" />
Please note, you only need to alter the maxRequestLength to support larger uploads. However the requestLengthDiskThreshold specifies how much of an upload should be streamed to memory (RAM), before buffering the rest to disk. As RAM is typically an order of magnitude faster than disk, if you have a reasonable amount of RAM then it's common to update it to the same value. DO NOT make it larger, as that has been shown to cause issues.
Upload time
Another factor to consider is the time which a large file upload may take. If a user is on a slow connection, then even a small file may take a few minutes to upload. In asp.net the default timeout for executing requests is 110 seconds. If you have users with slow connections or users with fast connections who are uploading very large files, you may want to consider setting the executionTimeout to ensure they have sufficent time. In the example below, these values allow 10MB uploads and permit the script to wait 3 minutes (180 seconds) before failing the upload.
<httpRuntime useFullyQualifiedRedirectUrl="true"
executionTimeout="180" maxRequestLength="10240"
requestLengthDiskThreshold="10240" />
IIS7 and above
The
<system.webServer>
element was introduced in IIS 7.0 and contains configuration elements that define the settings used by the Web server engine and modules. This add's another field you should be aware of in regards to working with large files that may require you to manually update your web.config if you're using IIS7/IIS7.5
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="300000000" />
</requestFiltering>
</security>
</system.webServer>
The maxAllowedContentLength is specified in bytes so 300000000 is roughly 300 megabytes.
Reference:More details on the HttpRuntime settings can be read
hereMaximum File sizes
Maximum file sizes differ based on the operating system and its associated version of Internet Information Server (IIS). In most cases, sites will be hosted on IIS7 or later ( as IIS6 is no longer supported by Microsoft), so the maximum size of a file is the smallest of the two settings. The maxRequestLength indicates the maximum file upload size supported by ASP.NET, the maxAllowedContentLength specifies the maximum length of content in a request supported by IIS. Hence, we need to set both maxRequestLength and maxAllowedContentLength values to upload large files.
One thing to be aware of is that although maxRequestLength is stored as a .net integer and therefore can be set as high as 2147483647 (approximately 2000 GB), maxAllowedContentLength is stored as a .net uint and therefore can only store numbers as high as 4,294,967,295 (approximately 4GB as the value is for size in bytes). This means that the maximum size for a file for any recent version of IIS is 4GB.
HTML Editor provider
In 6.1.3 the HTML Editor provider was updated to allow for the file size of uploads to be changed. To set this log in as a superuser (host) and go to host-> html editor manager, expand the media manager settings and set the Max File Size.
Video
Chris Hammond has a video demonstrating
how to enable larger file sizes in the video gallery.
Other notes
Allow for extremely large uploads/downloads -this forum thread details IIS metabase changes to enable extrememely large uploads/downloads i.e. 2GB or higher