Is the 5 MB static resource size limit 5,242,880 bytes or 5,000,000 bytes?

Documentation such as Static Resources says:

A single static resource can be up to 5 MB in size. An organization
can have up to 250 MB of static resources.

We have one growing static resource of size 4,950,663 bytes, so it would be good to know whether the limit is 5,242,880 bytes or 5,000,000 bytes.

Answer

It’s 5,000,000 bytes. In Salesforce, all storage units are per SI units, where megabyte means 1,000,000, and mebibyte means 1,048,576. Nowhere in Salesforce are the SI units for kibibyte/mebibyte/gibibyte, etc used in the documentation explicitly. Good luck finding this explicitly mentioned in the documentation, but note that this trend is consistent across all such limits (6MB Apex code, 10MB Custom Settings, etc). The rare exception to this rule are the field size limits (e.g. 32KB is 32,767 characters).

Attribution
Source : Link , Question Author : Keith C , Answer Author : sfdcfox

Leave a Comment