HttpModule Application Keys


HttpModule configuration is performed by adjusting a number of application keys located in the web.config file of the FileUpEE application:

  1. Open your FileUpEE application

  2. Open the web.config file for your application.

  3. In the web.config file, navigate to the <appSettings> node.

A sample web.config can be found on this page: Example web.config file for FileUpEE application with HttpModule



HTTPModule Application Keys

These application keys change settings on the FileUpEE HttpModule

HTTPModule Application Keys
AllowClientOverride If this key is set to true, the X-SaWsMaxKBytesToCancel header can be used to set the maximum Kilobytes permitted to be sent through FileUpEE. If this value is false, the MaxKBytesToCancel setting from the web.config file will instead be used, and the X-SaWsMaxKBytesToCancel header setting will be ignored.

This setting should only be used while testing resumability and should always be turned off in production.

DynamicAdjustScriptTimeout If this key is set to 1, the script's tiemout value will be increased until an upload is complete. Use DynamicAdjustScriptTimeout to ensure that large uploads will not be timed out. To disable DynamicAdjustScriptTimeout, set it to 0.

ErrorLogDestination ErrorLogDestination sets the type of error logging that FileUpEE will use. To enable error logging, set ErrorLogDestination to one of the following values:
SALogDestination Values
0Errors will not be logged.
1Errors will be logged in the file set by ErrorLogFile.
If ErrorLogDestination is set to 1, set ErrorLogFile.
ErrorLogFile ErrorLogFile sets the physical path and file name of the FileUpEE HttpModule error log file. In order for the error log file to be successfully created, you must give read and write permissions on the parent folder to the ASP.NET Machine Account user on the server. The HttpModule will log errors in a file if ErrorLogDestination is set to 1.
FileUpEETempDir FileUpEE's interceptor - the HttpModule - caches request data before it is processed by ASP.NET. Set a different temp directory by setting the value of FileUpEETempDir.

The temp directory must be the physical path to a directory that is writable by the account under which the application is running. If you wish to cache to a network share, the account must have network privileges.
FilterAspDotNetAtNKiloBytes This key specifies the smallest ASP.NET upload size - in kilobytes - for which FileUpEE will use the HttpModule. If the size of an ASP.NET upload equals or is greater than the value of FilterAspDotNetAtNKiloBytes, FileUpEE's HttpModule will be used to process the upload.

Remember: In ASP.NET, the HttpModule only intercepts requests for files with the extension set at FilterAspDotNetFlagExtension, regardless of the value of FilterAspDotNetAtNKiloBytes. If, for example, is set to 4000000 and the server-side upload processing page is WebServer.aspx, the filter will not intercept uploads that are equal to or greater than 4000000 KB (4 GB).
FilterAspDotNetFlagExtension For performance reasons, FileUpEE's HttpModule does not intercept all ASP.NET requests. The FileUpEE samples have the HttpModule 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 servers with unnecessary use of the filters.

FilterAspDotNetFlagExtension allows you to change the file extension used to signal the filters 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 change the value of this application setting, you must add an extension mapping for the new extension to IIS. Additionally, you will need to add the new extension to the web.config file under the HttpHandlers and BuildProviders nodes.
FilterReadBufferNKiloBytes FilterReadBufferNKiloBytes allows you to change the buffer size for the input stream. The default value for this setting is 8 Kilobytes.
FilterWriteBufferNKiloBytes FilterWriteBufferNKiloBytes allows you to change the buffer size for the output stream to the temporary file. The maximum value is 32 Kilobytes, while the minimum value is 4 Kilobytes. The default value for this setting is 4 Kilobytes.
MaxKBytes MaxKBytes sets the size limit for an upload. MaxKBytes is a per-file limit, not a limit for the whole upload in a multiple-file upload. The HttpModule will stop writing the file to disk when its size reaches the value of MaxKBytes. Note that incomplete files will be saved and no error is thrown when the MaxKBytes limit is exceeded.

When MaxKBytes is set to zero, there is no size limit for uploaded files.

MaxKBytesToCancel The HttpModule will abort an upload when the size of the transfer reaches the value of MaxKBytesToCancel. No data will be written to the server's hard disk, the connection will be terminated, and the browser will display a "Page not found" message.

Setting MaxKBytesToCancel may reduce the threat of a Denial of Service (DoS) attack on the file server. When an upload size hits MaxKBytesToCancel, the connection to the server will be terminated, the ASP.NET page will finish executing, and the ASP.NET thread will be freed.

When MaxKBytesToCancel is set to zero, there is no size limit for uploads.
MaxReadMemoryKiloBytes MaxReadMemoryKiloBytes allows you to set the maximum limit on the size of the total input buffer memory space. This value should be a multiple of FilterReadBufferNKiloBytes. This setting can be used to balance the rate of input to the HttpModule to the rate of output. Once the max value is reached, the module will wait before reading in more data. This can be useful when the output rate is slower than the input rate. If the output rate is slower than the input rate, the bottleneck of backed up bytes can overwhelm the memory available and cause an Out of Memory exception.
A value of 0 disables this setting.
ProgressIndicator Set ProgressIndicator to 1 or true to enable FileUpEE's progress indicator.
ProgressIndicatorParam The ProgressIndicatorParam sets the expected progress indicator query string parameter to be passed from the client to the server in an upload with progress indication.
Resumable When Resumable is set to true on both the web server and the client (through XFileEE), FileUpEE will be able to resume an upload from client to web server that was suspended because of a network connection failure.
TraceLevelSwitch The TraceLevelSwitch is not strictly an application key, but is a switch set in the <switches> element of the <system.diagnostics> node. Turn tracing on or off. Tracing is used to create a debug log for the httpModule, and is for use during testing or debugging. It should probably be left off in production.
TraceLevelSwitch Values
0Off - The Trace Log is disabled.
1Errors - Only errors are logged by the HttpModule.
2Warnings - Warnings and errors will be logged by the HttpModule.
3Info - The entire contents of the intercepted requests are logged by the HttpModule. Additionally, the method calls of the HttpModule are logged
4Verbose - The entire contents of the intercepted requests are logged by the HttpModule. Additionally, the method calls of the HttpModule are logged in greater detail.
TraceLogFile TraceLogFile sets the tracing log file location, which must be a pre-existing physical path that is writable by the account under which the application is running. It can be enabled or disabled by the TraceLevelSwitch set in the <system.diagnostics> section of the web.config file. If trace logging is turned on but no TraceLogFile is specified, debug output will be sent to the debug listener, and can be examined with a program such as DebugView.
TransferStage TransferStage specifies the stage of an upload, which may be either web server or file server. On a web server, set TransferStage to 1. On a file server, set TransferStage to 2.
UseHttpModuleWithAspDotNet FileUpEE's 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. UseHttpModuleWithAspDotNet turns the installed filter on or off for ASP.NET uploads. To turn the installed filter off, set UseHttpModuleWithAspDotNet to 0. To turn the filter on, set UseHttpModuleWithAspDotNet to 1.

Copyright © 2010 SoftArtisans, Inc. All rights reserved.