Large Uploads in ASP



ScriptTimeout

ASP's ScriptTimeout property sets the length of time in seconds that ASP pages will allow for a script to execute. The default value of this property in IIS is 90 seconds. In a file upload, the ASP page must execute for the duration of the upload. If your user is transferring information over a slow line or is transferring a large quantity of information, it is easy to exceed this limit.

To increase the ASP ScriptTimeout in IIS:

  1. Right-click the application that will perform uploads, and select Properties.
  2. Select the Virtual Directory tab and click Configuration.
  3. Select App Options.
  4. In ASP Script Timeout, enter a value in seconds.

To increase the ASP ScriptTimeout in script, set the property Server.ScriptTimeout. For example:

<% Server.ScriptTimeout = 300 %>

The FileUp registry key DynamicAdjustScriptTimeout allows you to ensure that large uploads will not be timed out. If this key is set to True, IIS's ScriptTimeout value will be increased until an upload is complete.

To enable DynamicAdjustScriptTimeout:

  1. Open the Start menu and select Run...

  2. Enter regedit and click Ok.

  3. Open the folder HKEY_LOCAL_MACHINE\SOFTWARE\Software Artisans\FileUp\Parameters.

  4. Double click DynamicAdjustScriptTimeout. An Edit DWORD Value dialog will open.

  5. In the Value Data field, enter 1.

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


MaxClientRequestBuffer

The IIS parameter MaxClientRequestBuffer sets a maximum size for the first chunk of an HTTP request. The first chunk will usually contain only a request's header fields, which includes all data in a request that is not part of the request's entity body. The default value of MaxClientRequestBuffer is 128 KB.

AspMaxRequestEntityAllowed Metabase Property

In IIS 6.0, Microsoft introduced a new metabase property setting, AspMaxRequestEntityAllowed, to help users secure their web servers more easily. AspMaxRequestEntityAllowed lets users specify the maximum number of bytes allowed in the entity body of an ASP request. Unfortunately, this setting interferes with large FileUpEE uploads with ASP. If this setting is too low, you can observe the temp files being created but never saved, or IIS could return a 403 error response.

Additionally, multiple file uploads may return no error, but instead any file sent after the AspMaxRequestEntityAllowed value is exceeded will not be saved. The temp files will be created in the Path directory for all files in the transfer, but they will not be saved in the destination directory.

Hence, if you are performing large FileUpEE uploads in ASP on a server running IIS 6, you will need to edit the Metabase.xml file for your IIS installation. You can find your Metabase.xml file at C:\Windows\System32\Inetsrv. Find the AspMaxRequestEntityAllowed node and change the setting to a value just large enough for your largest uploads in bytes. For instance, if you expect no uploads greater than 1 GB, you can set the value to 1073741824.

For more information on the AspMaxRequestEntityAllowed metabase property, please read this article at the Microsoft Windows Server 2003 TechCenter: AspMaxRequestLengthEntityAllowed Metabase Property (IIS 6.0)


Top

Copyright © 2010 SoftArtisans, Inc. All rights reserved.