function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sai kumar 29sai kumar 29 

how to knpw total size of static resources in org

Hi All,

Please let me know how to know the total size of static resources uploaded in dev sandbox. I would like to know in that sandbox how much size is left for static resources to upload.
KaranrajKaranraj
Run this query in developer console and it will return the size in bytes then convert the bytes into MB to get the actuall size.Then subtract the convert size with 250 you get the remaining size. An organization can have up to 250 MB of static resources, total
SELECT SUM(BodyLength) FROM StaticResource

 
sai kumar 29sai kumar 29
Hi  I ran this query, got the number:262115968 Which is equivalent to 262 MB. But maximum static resource size is only 250. I think there is some thing wrong ? Please advise
KaranrajKaranraj
If you contain any managed package static resource then exclude that in your query and then get the result, because managed package components won't count towards your org limit
sai kumar 29sai kumar 29
Thank you so much for reply. Still having doubt  How can I remove managed package static resource in SOQL query? Thanks,
sai kumar 29sai kumar 29
Please let me know your email id for the same to discuss. On Monday, February 9, 2015 1:25 PM, sai kumar wrote: Thank you so much for reply. Still having doubt  How can I remove managed package static resource in SOQL query? Thanks,
sai kumar 29sai kumar 29
I have only one managed package -static resource which has size of 4178 bytes.  Now I subtracted 262115968--4178=262111790 bytes ==262 MB... Please advise. On Monday, February 9, 2015 1:28 PM, sai kumar wrote: Please let me know your email id for the same to discuss. On Monday, February 9, 2015 1:25 PM, sai kumar wrote: Thank you so much for reply. Still having doubt  How can I remove managed package static resource in SOQL query? Thanks,
KaranrajKaranraj
SELECT NamespacePrefix FROM StaticResource where NamespacePrefix = Null
If you have NamespacePrefix for your org just include that else run the above query to get your org static resource
sai kumar 29sai kumar 29
I am not sure why I need to run the above query. I ran it, no results displayed.

Could Please give me full details that will help for my problem
DanCurryJrDanCurryJr
Are you calculating your MB count by taking bytes / 1000000?  or are you using Bytes / 1048576?  Remember that it takes 1024 Bytes to make a KB, and 1024 KB to make 1 MB.  So if you take your current usage (262115968 Bytes) and divide by 1048576 you end up with 249.97 MB.

And while managed packages may not directly count against your limit, you should be aware that Salesforce does consider them when conducting an analysis on your org's health.