How to Insert File with Dataloader in Salesforce

In Salesforce, Data Loader is a client application provided by Salesforce to facilitate data management, and with the help of this tool, we can insert, update, delete, or export records. It saves a lot of users’ time by automating and streamlining the task of importing and exporting the data in Salesforce.

If you working as a System administrator then data loader is a handy tool for you when you need to import or export the data in your org environment. The Data loader is efficient in transferring bulk data that too with an automated process.

In this Salesforce tutorial, I will explain the method of inserting or uploading files in records with the help of Dataloader. Along with this, we will also discuss the blueprint of a .csv file through which we will upload the record.

Insert File with Dataloader in Salesforce

To insert files using a data loader, you must have administrative access to records and have the data loader installed on your system. If you meet these conditions, follow the steps below.

1. First, we will create a CSV file with the columns heading mentioned below.

Title – Enter the name of the file and the user will see this file name in the related list folder.

Description – Enter the description of the file.

VersionData – Enter the location path of the file that you have to upload from your system.

PathOnClient – It is required to enter the complete path of the file that you will upload.

See also  How to Mass Delete Opportunities in Salesforce using Data Loader

FirstPublishLocationId – In this column, enter the ID of the Salesforce object record to which the file gets associated. To get this ID open the record and copy the ID from the URL. For example, in the URL “http//Contact/0035i00003ORfzxAAD/view” the id is referred to as 0035i00003ORfzxAAD.

After creating the csv file save it in your system.

Upload files in Salesforce records using data loader

2. Now login to your data loader, click on the Settings tab then select Settings.

Select batch size for uploading files in Salesforce with data loader

3. In the settings of the data loader go to the field Batch size and enter it according to the number of records. I am uploading one record so I have entered it as 1.

The default batch size in Data Loader is 200 or, if you select “Enable Bulk API”, the default batch size is 2,000. 

Insert files in Salesforce using data loader

4. In this step, we will select the data object and for that activate the checkbox Show all Salesforce objects then in the list select the option Content Verison.

After this browse the CSV file and click on the Next button.

Insert files in Salesforce records using data loader

5. As we click on the Next button, a pop-up will appear showing the number of rows in the file, Batch Size, Used API, and API usage limit of the org, here click on the OK button.

6. In this step, it is optional to add the Lookup fields that you can select from the fields Content Document, after this click on the Next button.

Lookup fields in for importing files in Salesforce using Data Loader

7. In this step, we will do the mapping of column headers in csv file with the standard Salesforce objects and for that click on the button Create or Edit a Map.

See also  How to Update Data with Data Loader in Salesforce

In the next window, click on the button Auto-Match Fields to Columns and this will auto-fill the lookup name of the objects according to the CSV column headers.

After this click on the OK button then click on the Next button.

Mapping of objects to import with files with data loader

8. In this window, select a folder to save the success and error files of the import that can be accessed later, and after this click on the Finish button.

Insert records using data loader in Salesforce

9. In this warning message window, click on the Yes button to proceed.

Import data from csv files using Salesforce Data loader

10. After the successful insertion of files, a message of operation completion will appear showing the errors and success of the operation.

File insertion success in Salesforce Data Loader

We can see that in the above image, we have inserted 4 records with CSV files and we got 4 successful inserts and 0 errors that indicates a complete successful insertion.

11. Now to view the inserted files open the record that you have entered in the FirstPublishLocationId. In this example, I have inserted the files in the account object.

Upload files in Salesforce records with data loader

As we can in the above image the files are successfully inserted into the Account record.

In this way, we can insert files with Data Loader in Salesforce by following the above steps.


In Salesforce, uploading files in internal records using Data Loader is an efficient way of data handling that enhances data management capabilities. By following the above steps, you can efficiently insert files in Salesforce using the data loader.

Along with this, you might have insights to create a CSV file by defining the header columns as we have discussed above.

See also  How to Bulk Create Campaigns in Salesforce Via Data Loader

You may like to read