sharepoint web service Maximum request length exceeded even if the file is inside the max file size

3.6k Views Asked by At

I have configured the web.config to allow 50 MB <httpRuntime maxRequestLength="51200" /> but when I try to add an Atachment of 40MB to a sharepoint list it fails. But it works if I increase the maxRequestLength to 52 MB <httpRuntime maxRequestLength="53248" />.
What is happening?? does the web service call increse the size of the request? is there a way I can fix this, so if I configure the maxRequestLength to 50 MB it allows the 50 MB ?

3

There are 3 best solutions below

2
On BEST ANSWER

A file that is uploaded via WSS 3.0 Web Services is actually put in the XML message itself. In order for that to happen it becomes Base64 encoded. This will then increase the file size by 33% due to the nature of that process. You will have to make sure to allow for 33% more than your largest files in the web.config setting you referred to.

1
On

Run Fiddler while making the web service calls, you can then see the contents of your call and how large it is. That should help figure out what, exactly, the overhead is for the particular webservice call.

0
On

The Webservice will probably base64 encode the file, this is bound to be bigger than the actual binary file (and sharepoint UI just uses regular FileUpload)