Search This Blog

Thursday, October 17, 2013

Maximum request length exceeded error while uploading files of size more than 50MB

Recently one of our SharePoint users came up with an issue that they were not able to upload files to SharePoint. It was giving him an access denied message. I checked for the permission for the user and the user had contribute permissions. The access denied message appeared only when the file size was more than 50 MB. The user was able to upload files of size lesser than 50 MB.

I checked in Central Administration ->Application Management-> Manage web application- >Select web application -> General Settings ->Maximum Upload Size .It was 200 MB

I checked the event viewer on the SharePoint server and saw the below error.

Request Url : 'https://servername/sites/sitename/_layouts/UploadEx.aspx?List={0CB029E1-5FA0-427D-A871-652E1748D8FD}&RootFolder=&IsDlg=1'
Maximum request length exceeded.
Exception Type: System.Web.HttpException
Exception Source: System.Web @ GetEntireRawContent

Resolution

I checked the web.config file of the associated web application and I noticed this.

<system.web>
<securityPolicy>
<trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\config\wss_mediumtrust.config"/>
<trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\config\wss_minimaltrust.config"/>
</securityPolicy>
<httpHandlers/>
<customErrors mode="On"/>
<httpRuntime maxRequestLength="51200"/>


If you see this the maxRequestLengthparameter for httpRuntime was set to 50 MB. Please note that the value listed here is in kB. I changed this to a higher value (204800 to match the 200 MB in Central Administration).

<httpRuntime maxRequestLength="204800"/>

No comments:

Post a Comment

Propellerads