Enterprise
Edition

 

Large Uploads in IIS 6


IIS 6 presents two obstacles to very large file transfers: inefficient memory utilization and a 4-GB request size limit. To overcome these problems in IIS6, FileUpEE provides the HttpModule and supports chunked transfer-encoding.

The HttpModule

FileUpEE'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 sending it 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.

With the FileUpEE registry key FilterAspDotNetFlagExtension, you can change the file extension used to signal the HttpModule in ASP.NET (.uplx) to a different extension of up to seven characters. By using a file extension other than .uplx you can hide your web server implementation (Windows/IIS) from potential hackers.

If you install the ASP.NET version of FileUpEE, the automatic installation package will install the HttpModule for FileUpEE'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.

Unlimited Upload Size on the Client
While FileUpEE can process uploads of any size, 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 XFileEE.
The HttpModule and Progress Indication
Under ASP.NET, FileUpEE's progress indicator is handled by the HttpModule. So, to display accurate progress indication, upload to a file with the .uplx extension.
The ISAPI Filter and IIS 6
FileUpEE's ISAPI filter is not installed by default on Windows 2003 server and cannot be used with IIS 6 running in native IIS 6 mode. The ISAPI filter can be used with IIS 6 running in IIS 5 mode (for manual installation insructions, see Installing the ISAPI Filter). The ISAPI filter cannot be used with chunked transfer-encoding.

Chunked Transfer-Encoding

IIS 6 gets the size of a request from the request's content-length header, and does not accept requests larger than 4-GB. By default, IIS 6 accepts requests of no more than 1-MB. You can increase this value by resetting the IIS 6 properties MaxRequestEntityAllowed or AspMaxEntityBodyAllowed, but the maximum value is 4-GB.

To overcome the request size limits imposed by IIS 6, FileUpEE supports chunked transfer-encoding. A chunked file transfer is sent as a series of chunks, each preceded by its own size indicator. A chunked transfer request does not include a content-length header for the whole request. Since IIS 6 rejects a request because of the size of the request's content-length header, it finds no reason to reject a request without a content-length header. With chunked-transfer encoding, no matter how large the upload, it will not be rejected by IIS 6.

To prevent misuse of chunked uploading, FileUpEE allows you to control the maximum allowable file transfer through the MaxKBytes and MaxKBytesToCancel properties.

Browsers do not support chunked transfer-encoding. To send a chunked upload from client to web server you must use SoftArtisans XFileEE. Chunked transfer-encoding is not supported by Microsoft ISA Server and Microsoft Proxy Server. If your requests must go through ISA Server or Proxy Server, you cannot use chunked-transfer encoding.

To enable uploads of more than 4-GB to IIS 6 (running in native IIS 6 mode), you must use chunked-transfer encoding.

To send a chunked upload from web server to file server, on the web server set FileUpEE.TransferEncoding to saChunked. Set TransferEncoding after setting TransferStage, and before ProcessRequest.

Set oFileUpEE = Server.CreateObject("SoftArtisans.FileUpEE")
oFileUpEE.TransferStage = saWebServer
oFileUpEE.TransferEncoding(saFileServer) = saChunked
...
oFileUpEE.ProcessRequest Request, False, False
Do not set TransferEncoding to saChunked if you are using the ISAPI filter. The ISAPI filter cannot handle chunked requests.

The following 3-tier upload samples send the upload from web server to file server as a chunked request:

A 3-Tier Chunked Upload in ASP (VBScript)

[Run Sample] | [View Source: Form] [View Source: Web Server] [View Source: File Server]

A 3-Tier Chunked Upload in ASP.NET (VB.NET)

[Run Sample] | [Form] [Code behind: web server] [File server] [Code behind: file server]

A 3-Tier Chunked Upload in ASP.NET (C#)

[Run Sample] | [Form] [Code behind: web server] [File server] [Code behind: file server]

Top


Copyright © 2005, SoftArtisans, Inc.