To begin with, the Support for Large Files was one of the enhancements made in Windows SharePoint Services SP 1. By default, the maximum size for uploading files is set to 50 MB. The maximum file size that it can go up to is 2,047 megabytes.
Now it is obvious that any cap on the maximum file size will stop the users from trying to upload larger files (including me!). Though SharePoint is meant to handle files that are up to 2 gigs in size, it is not practically feasible and not recommended as well.
However, there are circumstances where files of much smaller size fail to upload which makes one wonder as to what could be the reason. Hence I decided to write this post for all those who have come across this issue and are looking for some options to work around it.
Below are the common error messages that you may encounter while trying to upload large files based the operation system and the version of IIS
- WSS 3.0 or MOSS on a Windows 2003 server; when we upload any document larger that 50 megs on any document library, we get an error message as "An unexpected error has occurred"
- WSS 3.0 or MOSS on Windows 2008 server; when we upload any document larger that 28 megs on any document library, we get the error message as "The page cannot be displayed." In some circumstances, we may also get a "HTTP 404" error.
If you are using explorer view, the error message would be similar to
Could not find this item --> This is no longer located \\Servername\DavWWWRoot\team. Verify the item's location and try again".
This can occur due to various reasons and I have listed a few of the possible causes and the workarounds for them.
WORKAROUND(s)
Method 1 Increase the maximum upload size for the web application
Note : The default max single file upload size is 50 megs by default for a web application (in IIS 6.0) and 28 megs for IIS 7.0.
a. Go to 'Start > All Programs > Administrative Tools > SharePoint Central Administration > Application Management'.
b. Under SharePoint Web Application Management, click 'Web application general settings’.
c. On the Web Application General Settings page, choose the appropriate web application.
d. Under Maximum upload size, type the file size which you want to upload and click on OK. You can specify a maximum
file size up to 2,047 megabytes.
Note:
Any upload size which is below 50 megs is enforced directly through web app settings. Above 50 megs, you need to make a some small change to the web.config file to allow larger uploads. Repeat the steps listed below for all zones for your web app all the servers which host the web application role.
- Open the web.config from 'C:\Inetpub\wwwroot\wss\VirtualDirectories\<Virtual Directory>' folder and modify it as follows
- Replace as follows
<httpRuntime maxRequestLength="51200" /> with <httpRuntime executionTimeout="999999" maxRequestLength="51200"/>
- Perform an IISReset and you should be good to go.
See <httpRuntime> element in web.config for more information.
Method 2 Increase the connection time-out setting in IIS
By default, the IIS connection time-out setting is 120 seconds. To increase the connection time-out setting, follow these steps
a. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
b. Right-click the virtual server that you want to configure, and then click Properties.
c. Click the Web Site tab. Under Connections, type the number of seconds that you want in the Connection time-out box,
and then click OK.
Method 3Increase the maximum upload size in the web.config file of web application
By default, the web.config file is located in the 'C:\Inetpub\Wwwroot\Wss\Virtual Directories\<Virtual Directory>' folder. Add the following configuration to the web.config, just before the <configuration> section closes out.
Here’s a screenshot of the web.config file after the change:
This sets the value of the maxAllowedContentLength property to 52428800 (in bytes) for the web application only.
See KB944981 - You cannot upload files that are larger than 28 MB on a Windows Server 2008-based computer that is running Windows SharePoint Services 3.0.
Note:
The following information is applicable to IIS 7.0 and suggests making a change to the ‘applicationhost.config’ file which is a core configuration file for IIS. For more information, see
The maxAllowedContentLength property specifies the maximum length of content in a request in bytes and it needs
to be set on a Windows Server 2008 computer that has IIS 7.0-only installations. To change the value of the property, do the following
- Open command prompt and go to 'C:\windows\system32\inetsrv' directory
- Run the below command
appcmd set config /section:requestfiltering /requestlimits.maxallowedcontentlength:unit
where the variable "requestlimits.maxallowedcontentlength" unit specifies the maximum length of content.
For example, to specify 2000000000 as the maximum length of content, type the following at the command prompt, and then press
ENTER:
appcmd set config /section:requestfiltering /requestlimits.maxallowedcontentlength:2000000000
- Perform an IISreset /noforce.
- More info is available at
Method 4Increase the default chunk size for large files
The large-file-chunk-size property sets the amount of data that can be read from server running SQL Server at one time.
- If you have a file that is greater than your chunk size (such as 70 MB when the chunk size is set to 5 MB), the file would
be read in 14 chunks (70 / 5).
- The chunk size is not related to the maximum upload file size.
- The chunk size simply specifies the amount of data that can be read from a file at one time. By default, the large-file-
chunk-size property is set to 5 MB.
- In order to set the large–file–chunk–size property, we need to use the command line. This property is configured for a
server or server farm, and cannot be configured for an individual web app server. To set this property, use the following
syntax:
Stsadm.exe –o setproperty –pn large–file–chunk–size –pv <size in bytes>
More on this command is available at Large-file-chunk-size: Stsadm property (Office SharePoint Server)
- After making a change to this property, perform an IISreset /noforce.
See What is the maximum value one can set for the Large-file-chunk-size ?
Method 5 Add the executionTimeout value
Increase the execution timeout for the upload page (upload.aspx) to prevent timeouts on the page. The default timeout for
ASP.NET 2.0 is 110 seconds, so any uploads that are taking longer than that will result in a request failure. Add the
executionTimeout value to web.config in the 'C:\Program Files\Common Files\Microsoft Shared\web server extensions\12
\TEMPLATE\LAYOUTS' folder and the C:\Inetpub\wwwroot\wss\VirtualDirectories\<Virtual Directory>' folder.
- Navigate to 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS' folder
on the SharePoint server.
- Open the 'web.config' file in notepad or any other text editor and add the executionTimeout parameter. For example,
replace the value as follows
Existing code
<location path="upload.aspx">
<system.web>
<httpRuntime maxRequestLength="2097151" />
</system.web>
</location>
Replacement code
<location path="upload.aspx">
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151" />
</system.web>
</location>
- Open the 'web.config' file from the 'C:\Inetpub\wwwroot\wss\Virtual Directories\<Virtual Directory>' folder and modify it
as follows
Existing line : <httpRuntime maxRequestLength="51200" />
Replacement line : <httpRuntime executionTimeout="999999" maxRequestLength="51200" />
- Save the file and perform an 'IISreset /noforce'.
Large file support limitations
The following features do not support files larger than 50 MB
- Virus checking
- Picture libraries
- Streaming files
- Client-side restoration of smigrate backup files (limited to 2 GB). The manifest files for an smigrate backup cannot be
larger than 2 GB.
- Site templates (limit of 10 MB per site template, including content).
Additional Info