404 error when uploading large files to Sharepoint Document Library
Posted on 27. Nov, 2009 by admin in Sharepoint
When uploading larger than 28 MB files to a SharePoint library, you get 404 error. This occurs because SharePoint , IIS , Windows needs to be configured to handle large files.
Solution:
To solve the issue:
- Opened the file : %windir%\system32\inetsrv\config\applicationhost.config
In the ApplicationHost.config file, locate the node.
add a large value that matches the size of the Content-Length header that the client sends as part of the request. By default, the value of the maxAllowedContentLength property is 30000000.
- From IIS increase the connection time-out setting
- Increase the maximum upload size from Central administration > Application Management > Web Application General Settings
- Add the executionTimeout value in Web.Config under “Program Files\Common Files\Microsoft Shared\Web server extensions\12\TEMPLATE\LAYOUTS” so it becomes like the following:
<location path=”upload.aspx”>
<system.web>
<httpRuntime executionTimeout=”999999″ maxRequestLength=”2097151″ />
</system.web>
</location>
- Open Web.Config , By default, this file is in the following folder: Inetpub\wwwroot\wss\VirtualDirectories\VirtualDirectoryFolder
Change the following line in the file
<httpRuntime maxRequestLength=”51200″ />
To
<httpRuntime executionTimeout=”999999″ maxRequestLength=”51200″ />
- Changed the database timeout duration
To set the timeout value to 300 seconds, use the following syntax:
stsadm -o setproperty -pn database-command-timeout -pv 300
To view the current setting of the database-command-timeout property, use the following syntax:
stsadm -o getproperty -pn database-command-timeout
- Add the following code to the section of the Web.config file:
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength=” 2147483648″/>
</requestFiltering>
</security>
</system.webServer>
Where the value “2147483648” is equal to 2 GB
Hope this helps
