Equisys technical notes

Technical guidance, explanations and fixes for our products

PRB: Error when archiving files larger than 1MB to SharePoint

Print

ZTN4389

ID: ZTN4389

This Zetadocs technical note applies to:

  • Zetadocs for NAV 6.0 – 7.0
  • SharePoint 2010 and 2013 (on premise)

Symptom

When archiving a file that is over 1MB in size, in certain networks, the upload will fail and the user may see the following error text in a dialog or in the Zetadocs logs:

“The SharePoint site is invalid or unavailable.

Please ensure your SharePoint site is available and that your SharePoint site settings are correct.”

There will be additional information in the Zetadocs logs relating to a protocol violation:

Zetadocs.Exceptions.BaseException: The server committed a protocol violation. Section=ResponseStatusLine ---> System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine

   at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)

   at Zetadocs.SharePoint.SharePointDataStoreAccessor.< > c__DisplayClass4c.< CreateLargeFile> b__48()

   at Zetadocs.Exceptions.ExceptionHandler.Execute[T](Action action, Action`2 getContextAction, Func`2 handleExceptionFunc)

   --- End of inner exception stack trace ---

Cause

Zetadocs uses 2 methods to upload documents into SharePoint. One method is used for files smaller than 1MB, and the other method is used for any larger files. This is because SharePoint has a default upload limit for the first method of 2MB, so providing a different path for uploading larger files avoids any requirement to change SharePoint settings. However, the upload method for the larger files appears to be incompatible with more restrictive networks.

Resolution

It is possible to alter the behaviour of Zetadocs and SharePoint to allow upload of larger files using the first upload method by following these steps:

  • On the SharePoint server, log in as an administrator and launch the SharePoint Management Shell.
  • Run the following script commands:
    • $ws = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    • $ws.ClientRequestServiceSettings.MaxReceivedMessageSize = 209715200
    • $ws.ClientRequestServiceSettings.MaxParseMessageSize = 209715200
    • $ws.Update() 

This sets the maximum upload limit to around 200MB for the SharePoint server.

  • On each of the client machines, modify or add the following registry key:
    • (64 bit OS) Key: HKLM\Software\Wow6432Node\Equisys\Zetadocs\LargeFileThreshold
    • (32 bit OS) Key: HKLM\Software\Equisys\Zetadocs\LargeFileThreshold
    • Value (Decimal): 209715200

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Equisys cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved.

Status

Equisys is aware of this issue and will update this technical note when a solution has been found.

Last updated: 18th February 2015 (NT/JV) 

Keywords: Large file upload

Equisys Logo, Document Management and Expense Management for Business Central
 

Replaced by script