How to evaluate maxReceivedMessageSize based on file size

I have a requirement to upload a 1.5MB file. Given that this will be serialized for base64. What is a good way to evaluate the value that I need to use in setting WCF maxReceivedMessageSize?

+4
source share
1 answer

Base64 encoding increases the value of byte [] by about 33% - each 6-bit bit is mapped to one ASCII character, which takes one byte, so every 3 bytes (24 bits) in the input generates 4 bytes (24/6) in output). You are viewing ~ 2 MB for the file itself. If you add any other parameters to your operation, as well as SOAP overhead (envelope and headers), you should find a reasonable value for this parameter.

+5
source

Source: https://habr.com/ru/post/1482067/


All Articles