Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are seeing this error related to an http file transfer request

WCF error, System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded.

I've seen several posts related to this message, with the general response of just bump it to the max.

What if you want to force a limit on the file transfer size. We want to allow the user to only transfer files 60MB(62914560) and smaller.

Which setting should be set to 62914560? maxStringContentLength or maxArrayLength?

Is there overhead for the envelope around the request? In other words will the max allowed download file size be 60MB? Or is it smaller, file size + request overhead <= 60MB?

If it is the latter, can this be determined. Is the overhead fixed size? Or is the overhead a function of other settings (eg-maxBytesPerRead)?

Does SSL impact the file (overall message) size? How much?

I'm trying to understand exactly how it works. Changing the size seems arbitrary. How do I know what the correct setting value is to allow downloads of files that are only 60MB or less. One of the things I am seeing is that a zip file of 53776931 bytes will throw the exception. Prior to the download, I'm checking the size of the file and it is clearly less than 60MB. What is causing the message to exceed the maximum message size?
Posted
Updated 26-Feb-14 9:38am
v3

Increase the maxStringContentLength size.

SSL does not impact size. Even if it did, the advantages of SSL outweigh the size issue.
 
Share this answer
 
Setting must be applied to both the client and the SERVER sides.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900