web.config setup problem

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

web.config setup problem

bryanevil
Hi All I am having trouble at setting up the executionTimeout at the web.config firstly, the below web.config string work fine as it does restricting the upload file size:

    <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" useHttpModule="true" maxRequestLength="20" maxNormalRequestLength="4096"/>

 and then i modify it to this, it doesnt work because the file i tried to upload is still not allow to excess maxRequestLength="20" when i increase to 250000 inside the <location>:

    <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" useHttpModule="false" maxRequestLength="20" maxNormalRequestLength="4096"/>

<location path="Suppliers/ProjectTracking.aspx">
<system.web>
<httpRuntime maxRequestLength="250000" />
<customErrors>
                <error statusCode="413" redirect="~/NeatUpload/Error413.aspx" />
</customErrors>
</system.web>
<neatUpload useHttpModule="true" xmlns="http://www.brettle.com/neatupload/config/2008"/>
</location>

 and then i tried again with this (modified the location path), it return an error - The connection was reset. Supplier is a folder under the application root:

    <location path="~/Suppliers/ProjectTracking.aspx">
<system.web>
<httpRuntime maxRequestLength="250000" />
<customErrors>
                <error statusCode="413" redirect="~/NeatUpload/Error413.aspx" />
</customErrors>
</system.web>
<neatUpload useHttpModule="true" xmlns="http://www.brettle.com/neatupload/config/2008"/>
</location>


 What i want is to setup the executionTimeout for the ProjectTracking.aspx page, but seems i can't even apply the system.web setup from the section. Could someone help me out please. Thank you Bryan
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Dean Brettle
Administrator
You seem to have misunderstood the meaning of the various attributes.  Here is the correct interpretation:

<httpRuntime> maxRequestLength - ASP.NET will reject requests which are larger than the specified number of KB.  Defaults to 4096KB (I think).
<neatUpload> maxRequestLength - NeatUpload will reject requests which are larger than the specified number of KB.  Defaults to 2GB.
<neatUpload> maxNormalRequestLength - NeatUpload will reject a request if it is larger than the specified number of KB after all files uploaded from NeatUpload controls have been removed.  Defaults to 4096KB.

If you are trying to allow requests up to 250MB to Suppliers/ProjectTracking.aspx and you want to allow them to take up to 5 minutes (300 secs), you probably want:

    <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" useHttpModule="false" maxRequestLength="20" maxNormalRequestLength="4096"/>

<location path="~/Suppliers/ProjectTracking.aspx">
<system.web>
<httpRuntime maxRequestLength="250000" executionTimeout="300" />
<customErrors>
                <error statusCode="413" redirect="~/NeatUpload/Error413.aspx" />
</customErrors>
</system.web>
<neatUpload useHttpModule="true" maxRequestLength="250000" xmlns="http://www.brettle.com/neatupload/config/2008"/>
</location>
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
Thanks for your reply. It still doesnt work. for large file ~ 30mb in FireFox shows "The connection was reset" , in IE7 shows "Internet Explorer cannot display the webpage". However, small file is being uploaded, but progress bar didn't work; no notisfy of uploading and completed upload. Here is my complete web.config:

<?xml version="1.0"?><configuration>
    <configSections>
   
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
      <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" />
    </configSections>

    <appSettings/>
   
    <connectionStrings>
          <add name="AccessFileName" connectionString="~\App_Data\ASPNetDB.mdb" providerName="System.Data.OleDb"/>
        <add name="AccessdbConn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\Documents and Settings\fokbr\My Documents\Visual Studio 2008\Projects\TUV_MGB_PROJECT_MANAGEMENT\TUV_MGB_PROJECT_MANAGEMENT\App_Data\ASPNetDB.mdb;User Id=admin;Password=;" providerName="System.Data.OleDb"/>
    </connectionStrings>
    <system.web>
       

       
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
           
                <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.DynamicData, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

                <add assembly="System.ComponentModel.DataAnnotations, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
        </compilation>
       
        <authentication mode="Forms">
            <forms loginUrl="~/Login.aspx" name="TUV_MGB_PROJECT_MANAGEMENT_AUTH_TIMEOUT" timeout="1" protection="All" requireSSL="false"/>
        </authentication>
       
        <membership defaultProvider="AccessMembershipProvider">
            <providers>

                <clear/>
                <add name="AccessMembershipProvider" type="Samples.AccessProviders.AccessMembershipProvider, TUV_MGB_PROJECT_MANAGEMENT" connectionStringName="AccessFileName" enablePasswordRetrieval="false" enablePasswordReset="false" requiresUniqueEmail="false" requiresQuestionAndAnswer="false" maxInvalidPasswordAttempts="3" passwordAttemptWindow="30" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" applicationName="TUV_MGB_PROJECT_MANAGEMENT" hashAlgorithmType="SHA1" passwordFormat="Hashed"/>
               
            </providers>
           
        </membership>
        <roleManager enabled="true" defaultProvider="AccessRoleProvider" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" >
            <providers>
                <add name="AccessRoleProvider" type="Samples.AccessProviders.AccessRoleProvider, TUV_MGB_PROJECT_MANAGEMENT" connectionStringName="AccessFileName"/>
            </providers>
           
        </roleManager>

        <profile enabled="true" defaultProvider="AccessProfileProvider">
            <providers>
                <add name="AccessProfileProvider" type="Samples.AccessProviders.AccessProfileProvider, TUV_MGB_PROJECT_MANAGEMENT" connectionStringName="AccessFileName" description="Stores and retrieves profile data from an ASP.NET_Access_Providers1 database." />
            </providers>
            <properties>
                <add name="FriendlyName" type="string" allowAnonymous="true" serializeAs="String"/>
                <add name="Height" type="int" allowAnonymous="true" serializeAs="String"/>
                <add name="Weight" type="int" allowAnonymous="true" serializeAs="Xml"/>
            </properties>

       
        </profile>
       
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>

            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />

        </httpModules>

    </system.web>

    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
   
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>

        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
           
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>

            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>

                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" useHttpModule="false"/>

   
    <location path="~/Suppliers/ProjectTracking.aspx">
        <system.web>
            <httpRuntime maxRequestLength="250000" executionTimeout="300" />
           <customErrors>
                <error statusCode="413" redirect="~/NeatUpload/Error413.aspx" />
            </customErrors>
        </system.web>
        <neatUpload useHttpModule="true" maxRequestLength="250000" xmlns="http://www.brettle.com/neatupload/config/2008"/>
    </location>
</configuration>
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
I am doing this in my development machine. IIS 6.
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Dean Brettle
Administrator
I think maybe the <location path> attr doesn't understand "~".  Try "/Suppliers/ProjectTracking.aspx" or "Suppliers/ProjectTracking.aspx" instead.

--Dean

P.S.  You should also list NeatUpload's UploadHttpModule first in the <httpModules> section, and add it to the beginning of the <modules> section as well (slightly different syntax, see the NeatUpload manual for details) in case you ever move to IIS 7.
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
It works for the maxRequestLength now but not to the executionTimeout. executionTimeout = 1 means the upload process timeout and return error after 1 mintues from the start, isnt it? but it didnt work and the program completed the whole upload. PS i was trying onanother development machie which has IIS7
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Dean Brettle
Administrator
The executionTimeout value is in seconds, not minutes. Also, it is enforced by ASP.NET, not NeatUpload so I canLt promise that it will always block uploads that take longer. --Dean
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
Hi Dean Brettle I am doing the same at the other project, but when i run the program , debugger give me this error "Microsoft JScript runtime error: 'NeatUploadPB' is undefined". Do you have any idea why? Thank you Bryan
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
This is my web.config
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Dean Brettle
Administrator
Did you remember to copy the NeatUpload subfolder into your other project? --Dean
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
I got my problem solve. It was because I have created application folder access role at the root folder. The problem solved after I removed them. Sorry for the inconvenience. Bryan
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

Guest-1037
I got my problem solve. It was because I have created application folder access role at the root folder. The problem solved after I removed them. Sorry for the inconvenience. Bryan
Reply | Threaded
Open this post in threaded view
|

Re: web.config setup problem

rrlevron
Thanks for this posting.  I have been searching for some time now for a solution.  I have neatupload running in asp.net visual studio 2008 master page / content page environment.  I broke the master page relationship and still was not getting anywhere.  You had same issue.  After reading your post about the role issue, I commented out deny users / allow users line in my web.config file and the problem went away.

<authorization>
      <deny users="?" />  - this line
      <allow users="*"/> - this line
    </authorization>Now I just have to figure out another way to accomplish forms authentication.  Hehe.