How to import Files and Attachments with Dataimporter

Sam Hoult
May 27, 2024
You can easily Import Files and Attachments into Salesforce using Dataimporter.io. Simply put your files into a ZIP file, create a CSV reference file, and begin importing in minutes.
TIP: You should review the Batch Size and API type before inserting a large number of ContentVersion records. The recommended API Type for ContentVersion in Dataimporter is the REST API, with a Batch Size of 10. You will need to play around with the batch size to figure out what works for your use case.

Using Dataimporter you can import Files up to 2GB, and Attachments up to 50MB. Make sure you understand the difference between Files & Attachments before starting to import records. If you need to migrates Files and Attachments from one Salesforce Org to another, then please refer to the guide about how to complete a Salesforce to Salesforce Migration.

1. Create an Insert Job

Create a new Job, making sure you choose Insert as the Job type. In the Source, make sure you have selected CSV.

2. Upload your ZIP & CSV File

The ZIP file should contain all of the files that you wish to Insert. The ZIP file can either have a .zip or .7z extension. The CSV file must contain a column called 'PathOnClient'. This column should contain the name of the files as they are in your ZIP File e.g. if your ZIP file has a sub-folder called 'Attachments' and in the sub-folder is a file called 'document.pdf' then the PathOnClient column should have the value 'Attachments/document.pdf'.

3. Map the Fields

Map the fields based of the information if the CSV Formatting file. You should not map the Body field at this stage. To ensure that the Files are linked to parent records when they are inserted, then make sure you map the FirstPublishLocationId.

4. Preview your Insert

Preview your Mappings and Formula fields to make sure the Data is as you expect. Once you are happy with this, you can click on Submit to run the Job.

5. Run the Job

View the History of the Job to see how many records succeeded and Failed, as well as perform Functions such as Rollback.

Get Started with Dataimporter