Salesforce File Extractor: Download ContentDocuments with Ease

January 27, 2025

- views

Working with Salesforce ContentDocuments can be challenging, especially when you need to bulk download files for backup, migration, or analysis purposes. The standard Salesforce UI doesn’t provide an easy way to export multiple files at once, and the API requires some technical knowledge to use effectively.

To solve this problem, I created Salesforce File Extractor—a standalone Windows executable that simplifies the process of downloading files from Salesforce ContentDocuments.


What is Salesforce File Extractor?

Salesforce File Extractor is a Windows application that allows you to:

  • Download multiple files from Salesforce ContentDocuments in bulk
  • Authenticate using either Session ID or Username/Password
  • Select output directory for organized file storage
  • Run without dependencies—no Python or additional software required

The tool provides a simple graphical interface that makes it accessible to both technical and non-technical users.


Key Features

🔐 Flexible Authentication

The tool supports two authentication methods:

  1. Session ID (Recommended): Use an existing Salesforce session token. This method has been tested and works reliably.
  2. Username/Password: Authenticate directly with your Salesforce credentials. Note: This method is available but hasn’t been fully tested yet.

📁 Easy File Management

  • Choose your output directory before starting the download
  • Files are organized in the location you specify
  • No need to manually navigate through Salesforce’s file structure

🚀 Standalone Executable

  • No Python installation required
  • No additional dependencies
  • Just download and run—it’s that simple

How to Use

Step 1: Download

Download the executable from the GitHub repository:

⬇️ Download SalesforceFileExtractor.exe

Note: Windows Defender or your antivirus may flag the executable as a false positive. This is common with standalone executables. Click “More info” → “Run anyway” to proceed.

Step 2: Run the Application

Double-click SalesforceFileExtractor.exe to launch the application.

Step 3: Choose Authentication Method

Select your preferred authentication method:

  • Session ID (Recommended): If you have an active Salesforce session, you can extract the session ID from your browser’s cookies or developer tools.
  • Username/Password: Enter your Salesforce login credentials directly.

Step 4: Enter Credentials

Provide the necessary authentication information:

  • For Session ID: Enter your session token and Salesforce instance URL
  • For Username/Password: Enter your username, password, and security token (if required)

Step 5: Select Output Directory

Choose where you want the downloaded files to be saved. The tool will create the necessary folder structure automatically.

Step 6: Start Download

Click “Start Download” and let the tool handle the rest. The application will:

  1. Connect to your Salesforce instance
  2. Query all ContentDocuments
  3. Download each file to your specified directory
  4. Preserve file names and metadata where possible

System Requirements

  • Operating System: Windows 7 or later
  • Internet Connection: Required for connecting to Salesforce
  • No Additional Software: The executable is self-contained

Use Cases

This tool is particularly useful for:

  • Backup: Create local backups of all files stored in Salesforce
  • Migration: Export files before migrating to a new Salesforce org
  • Compliance: Download files for audit or compliance purposes
  • Analysis: Extract files for analysis or processing outside of Salesforce
  • Bulk Operations: Handle large numbers of files that would be tedious to download manually

Technical Details

The tool interacts with Salesforce’s REST API to:

  1. Authenticate using the provided credentials
  2. Query the ContentDocument and ContentVersion objects
  3. Retrieve file metadata (name, size, type, etc.)
  4. Download the actual file content using the ContentVersion’s VersionData field
  5. Save files locally with appropriate naming

Troubleshooting

Windows Defender Blocks the File

This is a false positive. To proceed:

  1. Click “More info” when Windows Defender shows the warning
  2. Click “Run anyway”
  3. Optionally, add an exception in Windows Defender settings

Antivirus Flags the Executable

Many antivirus programs flag standalone executables, especially those created with tools like PyInstaller. If you trust the source, you can:

  • Add an exception in your antivirus settings
  • Temporarily disable real-time protection during download

First Run is Slow

The first time you run the executable, it may take a moment to start. This is normal as Windows extracts and initializes the application files.

Authentication Issues

  • Session ID: Make sure your session is still valid. Session IDs expire after a period of inactivity.
  • Username/Password: Ensure you’re using the correct credentials and security token (if your org requires it).

Repository and Downloads

The source code and executable are available on GitHub:

🔗 View on GitHub

The repository includes:

  • The standalone executable (SalesforceFileExtractor.exe)
  • Source code (if you want to build it yourself)
  • Documentation and README files

Future Enhancements

Potential improvements I’m considering:

  • Filtering Options: Allow users to filter files by date, type, or related record
  • Progress Tracking: Show detailed progress for large downloads
  • Resume Capability: Resume interrupted downloads
  • Cross-Platform Support: Build versions for macOS and Linux
  • Batch Processing: Process multiple orgs in sequence

Security Considerations

When using this tool:

  • Session IDs: Treat session IDs as sensitive credentials—they provide full access to your Salesforce org
  • Credentials: Never share your Salesforce credentials
  • Output Directory: Ensure the output directory has appropriate permissions and isn’t publicly accessible
  • Network: Use secure networks when downloading files

Summary

Salesforce File Extractor simplifies the process of downloading files from Salesforce ContentDocuments. Whether you need to backup files, migrate data, or perform bulk operations, this tool provides a straightforward solution without requiring technical expertise or additional software installations.

The tool is available for download on GitHub, and I welcome feedback, issues, or contributions to improve it further.

⬇️ Download Now


Have questions or suggestions? Feel free to reach out or open an issue on the GitHub repository!