Talk to Expert

Complete Guide to Export Salesforce Static Resources

Share this Article:

Export Salesforce Static Resources
AI-Powered Reading

Explore This Article with AI

Get an instant summary, ask questions, or go deeper-open this page in your favourite AI tool in one click.

How to Export Salesforce Static Resources

To export Salesforce static resources—the CSS, JavaScript, images, and zip archives that support your Visualforce pages, Lightning components, and Apex code—you need the Metadata API, not a file export tool. Static resources are a metadata component type, retrieved and deployed through Salesforce CLI or the Metadata API, the same way Apex classes, flows, and object definitions are. This is different from exporting the files and attachments tied to your business records (accounts, cases, and opportunities), which uses a completely separate tool and workflow.

Thank you for reading this post, don't forget to subscribe!

How to Actually Export Salesforce Static Resources

A few native and CLI-based paths handle static resource export:

  • Salesforce CLI—the standard way to pull static resources from an org into a local project, ideal for version control, code review, or migrating between orgs.
  • Workbench—a free, browser-based tool that lets admins and developers browse and retrieve individual static resources without setting up the CLI, useful for one-off retrievals.
  • Change Sets—for moving static resources between connected orgs (e.g., sandbox to production) as part of a broader metadata deployment, though limited to same-org-family transfers.
  • Third-party DevOps platforms (Gearset, Copado)—for teams managing static resources as part of a larger CI/CD pipeline, with version diffing and rollback support.

If your goal is genuinely retrieving or backing up static resources as deployable metadata, this is the layer to use—a file export tool, including ours, doesn’t retrieve metadata API components.

Where File Export Tools Fit In: Business Record Attachments

Separately from static resources, most Salesforce orgs also accumulate a large volume of files and attachments tied to actual business records—contracts on opportunities, images on cases, and compliance documents on accounts. This is where native Salesforce export tools like the Weekly Data Export Service create real friction and where a purpose-built file exporter like Files Downloader is actually built to help.

Native exports force an all-or-nothing download, strip original file names in favor of unreadable ContentVersion IDs, and disconnect files from the records they belong to—turning a routine backup or audit request into a manual reconciliation project.

How to Bulk Export Salesforce Files and Attachments

Once static resources and record attachments are treated as the separate things they are, here’s the workflow for the attachment side with files downloaded:

1. Filter with list views or SOQL. Select records using standard or custom list views across Accounts, Opportunities, Cases, or custom objects, or run a custom SOQL query export against ContentVersion for more precise targeting.

2. Export with folder structure and metadata intact. Files retain their original names, folder hierarchy, owner, object type, and record association — no manual re-mapping needed afterward.

3. Run a one-click bulk download. No external scripts or developer tools are required—files export directly from the Salesforce UI you already use.

Static Resources vs. Business Record Attachments

 Salesforce Static Resourcesfiles downloader
What it coversCSS, JS, images for Apex/Visualforce/LightningFiles/attachments on business records
Retrieved viaSalesforce CLI, Metadata API, WorkbenchList views or SOQL Query Export
Use caseCode deployment, version controlAudits, migrations, storage cleanup
Best ForDevelopers, release managementAdmins, data teams, compliance

Because the file export runs natively within Salesforce and respects existing permission sets and sharing rules, exporting business record attachments doesn’t introduce a separate compliance risk into your audit or migration process.

Table of Contents

To export static resources, you can manually navigate to Setup > Custom Code > Static Resources and click View file to download individual assets. For bulk exports, use developer tools like Salesforce CLI (sf project retrieve start), VS Code with the Salesforce Extension Pack, or Workbench to retrieve all static resource metadata and zip files in one go.

Salesforce imposes a maximum size limit of 5 MB per individual static resource file, and a total limit of 250 MB of static resources per org. When exporting, ensure your local environment and deployment scripts accommodate compressed .zip packages if your static resources contain multiple bundled assets.

Yes, you can query static resource details using SOQL on the StaticResource object (e.g., SELECT Id, Name, ContentType, BodyLength FROM StaticResource). However, because the actual file content is stored as binary data in the Body field, exporting physical files requires using the REST API, Salesforce CLI, or a tool capable of decoding binary endpoints.

Static Resources are developer assets (such as CSS, JavaScript, images, or third-party libraries) managed under Setup for UI customization and code. In contrast, Salesforce Files (ContentVersion / ContentDocument) are end-user attachments (like PDFs, docx files, or invoices) attached to specific CRM records like Accounts, Contacts, or Opportunities.