views:

896

answers:

3

Hi, 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 ?

+1  A: 

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.

Nat
Interesting. I run fiddler and it shows the following:Request Count: 1Bytes Sent: 53,524,275Bytes Received: 0So, it means it is actually sending more than 50MB, but it is extrange because the same file can be added from sharepoint web site without problems. Now I just wonder if those more than 10MB are added by the webservice call how could I fix this?
dana_g
+4  A: 

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.

Marc
Thank you everybody. This forum is the best. I searched this and you are so right. "Base 64 encoding does increase the size of the data by a third" http://msdn.microsoft.com/en-us/library/ms996462.aspx
dana_g
Well of course I'm right. Just kidding. Glad to help, it is a great site.
Marc
+2  A: 

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)

Colin