How to Download Multiple Salesforce Files at Once as a ZIP

Somebody needs every file on an opportunity, by end of day, as one ZIP. Salesforce shows a download arrow beside each file and no obvious "download all". There is a built-in way to get several files in a single ZIP. It is just not exposed as a button in most places, and it has a ceiling that is worth knowing before you promise anyone four hundred files by five o'clock.

Method 1: The Built-In ZIP Download URL

Salesforce serves file downloads through a servlet that accepts more than one ID. Give it several and it returns a ZIP.

By document ID (latest version of each file):

https://YOUR-DOMAIN.my.salesforce.com/sfc/servlet.shepherd/document/download/069xx0000001AAA/069xx0000001BBB/069xx0000001CCC

By version ID (a specific version of each file):

https://YOUR-DOMAIN.my.salesforce.com/sfc/servlet.shepherd/version/download/068xx0000002AAA/068xx0000002BBB

IDs starting 069 are ContentDocument records and 068 are ContentVersion records. The difference is covered in our Files data structure guide.

Getting the IDs for one record

Run this in the Developer Console Query Editor, replacing the record ID:

SELECT ContentDocumentId, ContentDocument.Title
FROM ContentDocumentLink
WHERE LinkedEntityId = '006xx000001234AAA'

Copy the ContentDocumentId values, join them with slashes, append them to the document download URL, and paste it into a browser tab where you are already logged in to Salesforce. The browser downloads one ZIP.

Tip: a formula field or a small Flow can build this URL for a record automatically, which gives users a "Download all files" link on the page. It inherits every limit described below.

Where it stops working

  • URL length. Every file adds 19 characters. Browsers and servers cap URL length, so the list cannot grow indefinitely.
  • Size and time. The ZIP is built during a single request. Large totals time out, and a failed download starts again from zero.
  • Files only. Classic Attachments, Documents and Notes are not ContentDocuments and cannot be included.
  • Flat output. One ZIP, no folders. Combine files from several records and nothing tells you which file belonged to which record. Duplicate file names are common.
  • One record at a time. You run the query and build the URL per record. Twenty records means twenty rounds.
  • Sharing applies. The ZIP only contains files the logged-in user can access. Missing files are left out silently.

Method 2: Selecting Files in the Interface

Depending on where you are in Salesforce, some of this is available without touching a URL.

  • Files related list on a record. Each row has its own Download action. Simple, and one file at a time.
  • Content libraries in Salesforce Classic. The Content tab allowed ticking several documents and downloading them together as a ZIP. Orgs that still use Classic content libraries can use this for small sets.
  • Experience Cloud sites and custom components. Some orgs add a "download all" Lightning component. Under the surface these call the same servlet URL as Method 1.

The honest summary: the interface is built for a person retrieving a document, not for retrieving a document set.

Method 3: A Bulk Export Tool

Once the request is "all files on these 300 opportunities" or "everything on closed cases from last year", the task has changed from downloading to exporting. SFDC File Exporter is a desktop app built for that.

  • One record. Export Single Record downloads every file on the record, and can include its child records, each in its own sub-folder.
  • A set of records. Export from List View takes any list view. Export from CSV takes a column of record IDs from a report.
  • A whole object. Export from Object, with optional SOQL filters.
  • Attachments too. Files and classic Attachments are both supported, as are Documents and Notes.

Files arrive in folders by record, with their original names. If the recipient wants a single archive, right-click the output folder and compress it. You get a ZIP that has structure inside it, which the native ZIP never does.

Comparison

ZIP URLUI selectionSFDC File Exporter
Practical volumeTens of filesA handfulThousands and up
Multiple records in one goManuallyNoYes
Keeps record contextNoNoYes, folder per record
Classic AttachmentsNoOne at a timeYes
Resumes after a failureNoNoSkips files already downloaded
SetupNoneNoneDesktop install
CostFreeFreeFree up to 50 files per export, then from $49

Which One to Use

  • A few files from one record, once: the download arrow.
  • One record with a dozen or two files: the ZIP URL. It takes two minutes and installs nothing.
  • Many records, or more than about 50 files, or attachments involved: an export tool.
  • The same request every month: an export tool with a scheduled job.

Frequently Asked Questions

Can I download multiple files at once in Salesforce?

Yes, in a limited way. Salesforce will bundle several Salesforce Files into one ZIP if you request them through its download URL with the file IDs separated by slashes. Some views also let you select several files and download them together. Neither approach is designed for more than a few dozen files, and neither works for classic Attachments.

What is the Salesforce URL to download files as a ZIP?

For current versions by document ID use /sfc/servlet.shepherd/document/download/ followed by the ContentDocument IDs (starting 069) separated by slashes. For specific versions use /sfc/servlet.shepherd/version/download/ followed by ContentVersion IDs (starting 068). Add the path to your org's domain while logged in.

Is there a limit on how many files Salesforce will zip?

Salesforce does not publish a simple per-request file count for this URL, but there are practical limits: the browser and server cap URL length, large total sizes time out, and the request runs as a single synchronous download with no resume. In practice it is dependable for tens of files, not thousands.

How do I download all files from a Salesforce record?

For a handful, open the record's Files related list and download them, or build a ZIP URL from their IDs. For records with many files, or many records, use SFDC File Exporter's single record or list view export, which downloads everything linked to the record into one folder with original file names.

Can I zip and download classic Attachments the same way?

No. The ZIP download URL only handles Salesforce Files, meaning ContentDocument and ContentVersion records. Classic Attachments have no multi-download endpoint and must be fetched one at a time through the UI, by the API, or with an export tool.

A Useful Trick with a Low Ceiling

The ZIP download URL is worth knowing and solves the small version of this problem at no cost. It was never meant for volume. When the list of IDs gets long enough that you are editing a URL in a text editor, switch tools. Download SFDC File Exporter, point it at the list view, and let it bring the files down in folders you can hand over as they are.

Download Hundreds of Salesforce Files in One Run

When the ZIP link runs out of road, SFDC File Exporter downloads every file on a record, list view or object into organised folders. Free for 50 files per export.