Problem
Microsoft Internet Information Services (IIS) imposes a technical restriction on the size of files that can be uploaded to a site. The maximum file size that can be uploaded is 2GB. When you try to upload a large file near that limit, you receive one of the following errors:
"The underlying connection was closed. An unexpected error occurred on a receive. Increasing the configuration setting InternalRequestTimeout may avoid this issue."
Or
"Task failed due to unexpected server failure"
Or
"Could not upload file to server ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error"
Solution
To ensure that your system can upload large files to the site up to the 2GB limit:
-
Update the maxRequestLength setting in your File Service web.config file to 2000000000 in value.
<httpRuntime executionTimeout="108000" maxRequestLength="2000000000"/>
-
In the SPFAppServer.config file, ensure the VTLExportFileUploadTimeout and InternalRequestTimeout values are set at the default 108000000. This file is located in the Server Manager Site Settings node for both the staging and target system sites.
<add key="InternalRequestTimeout" value="108000000"/>
<add key="FileServiceTimeout" value="300000"/>
<add key="VTLExportFileUploadTimeout" value="108000000"/>