Handling large files

(Not Related to a Specific Release) - ...

When Outscaling needs to synchronize a large file (e.g. 15 MB), this often fails. When examining the (Six) logging (which should have been enabled first, of course), you will see a log message: An error occurred in syncFile:  Maximum request length exceeded.

This is not a bug, it's a built-in security feature of ASP.NET (maxRequestLength) which prevents posting large files. It's there for a good reason: preventing denial of service attacks. However, when it is required to synchronize files larger than the built-in default of 4 MB, you need to adjust the web.config.

MaxRequestLength

The maxRequestLength setting is configured using the httpRuntime element within the web.config. The example below sets the maxRequestLength to 64 MB.

XML CopyCode image Copy Code
<system.web>
 ...
 <httpRuntime maxRequestLength="65536" />
 ...
</system.web>

MaxAttachmentSize

When trying to synchronize an even larger file (e.g. 27 MB), this will usually fail as well, despite the maxRequestLength adjustment. Within the logging you will see a log message like: An error occurred in syncFile:  Attachment:One of the attachments exceeds the maximum size allowed. HRESULT=0x800A0BB8 - Server:Loading the request into SoapReader failed. HRESULT=0x80070057: The parameter is incorrect.

This is another file size limit imposed by the SoapReader object, which is used internally to deserialize the request. This limit is controlled using the MaxAttachmentSize registry setting. It has a built-in default of 10 (MB), but it is usually set to 25 MB in a standard Smartsite iXperion installation.

Outscaling - MaxAttachmentSize registry setting

To be able to synchronize files > 25 MB adjust this setting and set it to e.g. 50 (MB).

Notice when, for whatever reason, you have disabled the Outscaling external webservice, the regular ("internal") Outscaling webservice will be used for file synchronization and you will need to set the MaxAttachmentSize setting within the wsOutscaling registry key.

RequestLimits

IIS 7.0 has introduced a new built-in security feature: Request Filtering. It includes, among many other things, request limits. One of the settings for request limits is the maxAllowedContentLength, which specifies the maximum length of content in a request (in bytes). It defaults to 30000000, which approximately equals 28.6 MB.

When trying to synchronize a file which exceeds this limit, it will fail and within the logging you will see a log message like: An error occurred in syncFile:  Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A13BD - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A13BD - Client:Unspecified client error. HRESULT=0x800A13BD.

To adjust the maxAllowedContentLength, you need to adjust the web.config and add a requestLimits element, inside of a requestFiltering element, which is inside a security element (see example below).

XML CopyCode image Copy Code
<system.webServer>
  ...
  <security>
   <requestFiltering>
    <requestLimits maxAllowedContentLength="60000000" />
   </requestFiltering>
  </security>
  ...
</system.webServer>