Large Uploads in ASP.NET


ASP.NET Samples
FileUp includes many sample ASP.NET applications in both C# and VB.NET. To run the samples, open a browser window and enter the URL http://localhost/SAFileUpSamples. The sample code is in the folder FileUp\Samples.

The HttpModule

FileUp's HttpModule intercepts selected requests to overcome ASP.NET's inefficient memory utilization and to allow accurate progress indication. The HttpModule intercepts an upload request, reads all the data, and writes it to a temp file chunk by chunk, before forwarding the request to ASP.NET.

For performance reasons, the HttpModule will not intercept all ASP.NET requests. It will intercept ASP.NET requests for files with the extension .uplx. Files with the extension .aspx will not be processed by the filter, and will be sent directly to ASP.NET. This prevents burdening the server with unnecessary use of the HttpModule. So, to use the HttpModule, name your ASP.NET scripts FileName.uplx.

FileUp's automatic installation package will install the HttpModule for FileUp's samples, and create the script mappings for the .uplx extension. See Installing the HttpModule for instructions on installing the HttpModule at the application level or in the Global Assembly Cache.

Upload Size on the Client
While FileUp can process uploads of up to 4-GB, most browsers support uploads of up to 2-GB. Larger uploads must be generated by a client-side control that can handle very large transfers, such as SoftArtisans XFile.
Progress Indication in ASP.NET
Under ASP.NET, FileUp's progress indicator is handled by the HttpModule. Therefore, to display accurate progress indication in ASP.NET, upload to a file with the .uplx extension.

Top


ConnectionTimeout

IIS's Connection Timeout property sets a time in seconds at which the server will disconnect an inactive connection. The default value is 900 seconds. To allow very large uploads to complete it may be necessary to increase this value. To reset Connection Timeout:

  1. In IIS, right-click Default Web Site and select Properties.


  2. Select the Web Site tab.


  3. In the Connection Timeout box, enter a new value.

Top


.NET Settings

In the .NET configuration file for your Web application - web.config or machine.config- there are several attributes that can affect the performance of large uploads. To set these attributes at the machine level, modify machine.config (located in [windows directory]\Microsoft.NET\Framework\[.NET Version Directory]\CONFIG). To set the attributes at the application level, modify your application's web.config file.

You will find the following values in the httpRuntime node of machine.config:

The following attributes are in the processModel node of machine.config:

Top

Copyright © 2010 SoftArtisans, Inc. All rights reserved.