Base64 and Maximum Attachment Size in Dynamics CRM

Microsoft Dynamics CRM provides out-of-the-box functionality to store and associate small file attachments against an entity record. This is achieved via the annotation entity - it is similar to any other entity except that it stores meta data as well as the actual content of the file attachment within it.

As CRM is not designed to be a file store, it imposes some limitations on the size of attachments that can be uploaded. Recent versions of the product, including 2016, defaults this size to 5120Kb which can be adjusted to a maximum hard limit of 32768Kb.

However, there is one caveat with this limitation - CRM stores the byte stream in a base64 encoded format, this means that there would be an increase in the final saved file size.

I recently learned that the upload restriction is done based on the encoded file size and not the original byte stream as I was expecting. I imagine this would be especially important to remember when designing integration components that create annotation records.

References

comments powered by Disqus