How to change configuration in web server to allow upload of large files ?


When users cannot upload or attach large files/photos from field device or from the Clickhome desktop version, it requires configuration changes to our web service and web app web.config. By default the maximum file size allowed is limited to 4 MB. If business requires that files bigger than 4 MB to be uploaded, there are configuration changes required in website where ClickHome is installed. Most of the latest devices take high resolution images, the file sizes are larger and your old devices may have worked  and may still be working on old devices without making this configuration change in the web server.  Please contact your IT Administrator / IT Support to make the following changes in web server. 


Please note utmost care must be taken when editing the config file as incorrect editing affects field device rebuild,synchronization and accessing website.


For example: 

Assuming your web application and web service location (used in field device connection settings) are the following

http://xxxxx.clickhome.com.au/clickhome3/default.aspx

http://xxxxx.clickhome.com.au/clickhome3webservice/mmservices

You can find a applications named clickhome3 and clickhome3webservice in IIS. Right Click the application name on IIS under the right website > Explore to locate the web.config to find the correct config file to make the configuration changes. 


Refer the following link for further information 


http://stackoverflow.com/questions/3853767/maximum-request-length-exceeded


Here is the correct location of the two changes as per the stack exchange question. The following change will allow file sizes till 1024 MB to be uploaded.


<?xml version="1.0" encoding="utf-8"?>

<!--

  For more information on how to configure your ASP.NET application, please visit

  http://go.microsoft.com/fwlink/?LinkId=169433

  -->

<configuration>

  <connectionStrings configSource="ConnectionStrings.config"/>

  <!--

    For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.

      <system.Web>

        <httpRuntime targetFramework="4.5"/>

      </system.Web>

  -->

    <system.web>

    <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

    <webServices>

      <protocols>

        <add name="HttpGet"/>

        <add name="HttpPost"/>

      </protocols>

    </webServices>

    <!--<customErrors mode="On" defaultRedirect="ErrorHandler.aspx"/>-->

    <globalization uiCulture="en-AU" culture="en-AU"/>

    <compilation targetFramework="4.5" defaultLanguage="c#">

      <assemblies>

        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

      </assemblies>

    </compilation>

    <pages controlRenderingCompatibilityVersion="4.0"/>

  </system.web>

  <appSettings/>

<system.webServer>

   <modules>

      <remove name="WebDAVModule" />

    </modules>

    <handlers>

      <remove name="WebDAV" />

      <remove name="ExtensionlessUrlHandler-Integrated-4.0"/>

      <remove name="OPTIONSVerbHandler"/>

      <remove name="TRACEVerbHandler"/>

      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler"

          preCondition="integratedMode,runtimeVersionv4.0"/>

    </handlers>

 <security>

     <requestFiltering>

         <requestLimits maxAllowedContentLength="1073741824" />

     </requestFiltering>

 </security>

  </system.webServer>

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<dependentAssembly>

<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>

<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>

<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>

</dependentAssembly>

<dependentAssembly>

<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>

<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0"/>

</dependentAssembly>

</assemblyBinding>

</runtime>

</configuration>



ClickHome - Construction Software