Example web.config file for FileUpEE application with HttpModule



<?xml version="1.0" ?> 
    <configuration> 
        <system.web> 
        
            <!--This loads the FileUpEE HttpModule for this application. Version numbers 
                      must match the FileUpEeModule.dll exactly. --> 
            <httpModules> 
                <add name="FileUpEeModule" 
                    type="SoftArtisans.Net.FileUpEeFilter.Module.FileUpEeModule, FileUpEeModule, 
                        version=x.x.x.x, 
                        Culture=neutral, 
                        PublicKeyToken=f593502af6ee46ae"/> 
            </httpModules> 
            
            <!--Allows pages with this file extension to be processed by ASP.NET. This value
                     must match the value assigned to the FilterASPDotNetFlagExtension 
                     application key. -->
            <httpHandlers> 
                <add verb="*" path="*.uplx" type="System.Web.UI.PageHandlerFactory"/> 
            </httpHandlers>
    
            <customErrors mode="Off" /> 
            
            <!-- Two of these settings are important in relation to large file uploads: 
                       executionTimeout: Sets the maximum time in seconds that the page can run. 
                       Make sure to leave enough time to finish any uploads. 
                       maxRequestLength: Sets the maximum size in kilobytes of the entire 
                       request. The maximum allowed value for this is 2097151. This setting 
                       is applied only to the first chunk doing chunked uploads and is therefore
                       less important. -->
            <httpRuntime 
                    executionTimeout="1200" 
                    maxRequestLength="102400" />
    
            <!-- Uncomment this section for .NET 2.0 applications --> 
            <!-- <compilation>
                <buildProviders> 
                    <add extension=".uplx" type="System.Web.Compilation.PageBuildProvider" /> 
                </buildProviders> 
            </compilation> --> 
            
        </system.web>
        <appSettings> 
        
            <!-- All the following App Settings are required by the HttpModule and will 
                        result in an error if removed --> 

            <!-- Enable resumable uploads. --> 
            <add key="Resumable" value="true" />
            
            <!-- Allow client to override the MaxKBytes settings for resumability testing by 
                        sending "X-SaWsMaxKBytesToCancel" HTTP header. This should always be 
                        turned off in production. --> 
            <add key="AllowClientOverride" value="false" /> 
            
            <!-- Temp Directory is the cache directory that the httpModule will save 
                        files to. This directory must be accessible by your ASPNET or 
                        NETWORK_SERVICE user account with modify permissions. If impersonation
                        or another account is used, that account must have permissions. --> 
            <add key="FileUpEeTempDir" value="C:\Temp\FileUpEe\Cache\" /> 
            
            <!-- Transfer stage 1= WebServer, 2= FileServer --> 
            <add key="TransferStage" value="1" /> 
            
            <!-- Enable ASP.NET filtering - this should always be set to true if you want to 
                        use the HttpModule. --> 
            <add key="UseHttpModuleWithAspDotNet" value="true" /> 
            
            <!-- Extension to filter on. NOTE: this can only be a single extension; you 
                        cannot have multiple filter extensions. If you want to use the 
                        .uplx extension you will also need to change it here. --> 
            <add key="FilterAspDotNetFlagExtension" value=".uplx" /> 
            
            <!-- Start filtering ASP.NET at N Kbytes. If you set this to 10 then only 
                        files over 10K will get processed by the HttpModule. -->
            <add key="FilterAspDotNetAtNKiloBytes" value="0" /> 
            
            <!-- Stop caching upload if total request exceeds KBytes. After MaxKBytes is 
                        reached then the HttpModule will still pass the first MaxKBytes of 
                        the file to the ASP.NET page for processing. --> 
            <add key="MaxKBytes" value="0" /> 
            
            <!-- Cancel upload if is exeeds KBytes. After MaxKBytesToCancel is reached 
                        then the connection with the client will be dropped and the 
                        HttpModule will not pass anything on to the ASP.NET page 
                        for processing. --> 
            <add key="MaxKBytesToCancel" value="0" /> 
            
            <!-- Enable server side Progress Indicator. --> 
            <add key="ProgressIndicator" value="true" /> 
            
            <!-- Expected progress indicator querystring parameter for client to server progid. --> 
            <add key="ProgressIndicatorParam" value="progressid" /> 
            
            <!-- Dynamically adjust the script timeout higher while data is being transferred. --> 
            <add key="DynamicAdjustScriptTimeout" value="true" /> 
            
            <!-- Error Log Destination: set to 0 to disable, 1 to enable. --> 
            <add key="ErrorLogDestination" value="0" /> 
            
            <!-- Error Log File sets the location of the log file. This directory needs to 
                        exist and must be accessible by your ASPNET or NETWORK_SERVICE user 
                        account with modify permissions. If impersonation or another account 
                        is used, that account must have permissions. --> 
            <add key="ErrorLogFile" value="C:\Temp\logs\FileUpEeModuleError.log" /> 
            
            <!-- Tracing log file location. Enabled/Disabled by the TraceLevelSwitch set 
                        in the system.diagnostics section of the web.config. 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. --> 
            <add key="TraceLogFile" value="C:\Temp\logs\FileUpEeModuleTrace.log" /> 
            
            <!-- Buffer Size for the input stream - tune for best performance. --> 
            <add key="FilterReadBufferNKiloBytes" value="32" /> 
            
            <!-- Maximum Read Buffer Memory in Kilobytes Value should be multiples 
                        of MaxReadBufferNKilobytes --> 
            <add key="MaxReadMemoryKiloBytes" value="16000"/> 
            
            <!-- Temp File Stream buffer - tune for best performance. Maximum is 32K, 
                        Minimum is 4K --> 
            <add key="FileWriteBufferNKiloBytes" value="32" /> 
        </appSettings> 
        <system.diagnostics> 
            <switches> 
                <!-- 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. Trace Log Level 0= Off, 1= Errors, 2= Warnings, 
                           3= Info, 4= Verbose -->
                <add name="TraceLevelSwitch" value="0" /> 
            </switches> 
        </system.diagnostics>
    </configuration> 

Top

Copyright © 2010 SoftArtisans, Inc. All rights reserved.