Salesforce stores files as ContentDocument records. When you need to export thousands of them - for a migration, an audit, or an archive - Salesforce's native export tools fall short. Here is what actually works.
The Problem with Native Salesforce File Export
Salesforce does not provide a straightforward bulk download for ContentDocument files. The Data Export Service exports record data as CSV, but files - PDFs, Word documents, images, spreadsheets - are stored separately and are not included. To download them natively, a user must open each file record individually and click Download, which is impractical for anything above a handful of files.
Organisations frequently discover this limitation mid-migration: the CRM data moves cleanly but years of attached documents, contracts, and images remain stranded in the old org.
Option 1: Salesforce Data Loader (Limited)
Data Loader can export the ContentDocument and ContentVersion objects, giving you a CSV with metadata and base64-encoded file content. The problems:
- Files are exported as base64 strings in a CSV column - you need additional scripting to decode and save each file
- File names and folder structure are not preserved automatically
- Large files or high volumes frequently cause timeout errors
- No preview of what will be exported before running
For a handful of files this is workable. For thousands, it requires significant custom scripting to make usable output.
Option 2: REST API + Custom Script
A developer can query the Salesforce REST API, retrieve ContentVersion.VersionData for each file, and stream the binary content to disk. This produces clean output with original file formats preserved - but it requires:
- API access credentials and a connected app
- A developer to write and maintain the extraction script
- Handling for governor limits, pagination, and retry logic
- A separate mapping step to re-link files to their parent records
This is the right approach for technically capable teams running one-off migrations. It is overkill for recurring export requirements or non-technical users.
Option 3: SFDC File Exporter (Recommended for Most Teams)
SFDC File Exporter is a desktop application built by RASPSYS LLP specifically for this use case. It connects to your Salesforce org via OAuth, queries ContentDocument records against filters you define, and downloads each file to your local machine in its original format - preserving the original file name and organising files by parent record.
What SFDC File Exporter handles for you
- OAuth authentication - no passwords stored, no connected app setup required
- Filter by object type, date range, record owner, or custom SOQL query
- Preview export scope (file count and total size) before downloading
- Downloads files in original format - PDF, DOCX, XLSX, PNG, etc.
- Organises output into folders by parent record ID or record name
- Handles API pagination and rate limiting automatically
- Generates a manifest CSV mapping each downloaded file to its Salesforce record
- Processes entirely on your local machine - no data passes through RASPSYS servers
When to Use Each Option
| Scenario | Recommended Approach |
|---|---|
| Fewer than 100 files, technical user | Data Loader or manual download |
| Large volume, developer available, one-off | REST API + custom script |
| Any volume, non-technical user, or recurring export | SFDC File Exporter |
| Migration with file re-linking to new org | SFDC File Exporter + RASPSYS migration service |
Try SFDC File Exporter
SFDC File Exporter is available as a licensed desktop application. A free trial is available for evaluation. All processing happens locally - your Salesforce data never leaves your machine.