How to Upload Files in Salesforce

In our Salesforce organization, every time we onboard a new client, we ensure that all their important documents are properly uploaded to the Salesforce database. For each Account, we need to upload files like agreements, contracts, and images to store the ID proofs.

By uploading files directly to the Account or any other object record, we can ensure access to all documents for a specific record easily from the related list Files and Attachments.

In this Salesforce tutorial, I will explain how to upload files in Salesforce using both the manual method and the data loader for bulk field uploads.

Upload Files in Salesforce

In Salesforce, uploading files means adding and storing documents, images, or other types of files directly inside the system in a special object called File.

We can upload various file types, including PDFs, Word documents, images, videos, music, and GIFs. Once uploaded, these files can be managed easily. We can add details to describe them, set permissions to control who can access them, and share them with other users.

The Files feature offers a better approach for file storage in Salesforce, surpassing the older Documents feature as the recommended option for managing and sharing files.

Files can also be uploaded directly to the object records that can be accessed from the Notes and Attachments section of the record.

Upload Files in Salesforce

In Salesforce, there are two methods for uploading files, which we will discuss in the points below.

  • Upload files in Salesforce manually through UI
  • Upload files in Salesforce using Data Loader

Upload Files in Salesforce Manually Through UI

To upload files manually in Salesforce, we can either upload them directly to the record page of the object in the Files and Attachments section or upload them to Salesforce Files.

Upload Files in Salesforce Files

Now, follow the steps below to upload the files manually to the Salesforce Files object.

  1. To upload files to Salesforce, click the App Launcher and select “Files”.
Upload files in Salesforce
  1. In the Files home page, click the Upload Files button.
Manually upload files in Salesforce
  1. Drag one or more files from your system directly into the upload window. You can also browse and select the files that you need to upload. After selecting the files, click on the Open button.
How to Upload attachments in Salesforce files
  1. Click Done after the files have uploaded successfully.
Upload attachments in Salesforce files

This way, we can upload Salesforce files and store them in the Files object through the manual method.

Upload Files in Salesforce Files on Object Records

In Salesforce, we also need to upload files for specific records, such as contacts, accounts, and opportunities.

Follow the steps below to upload the files directly to the object record. In this example, I will upload files to the Contact record.

  1. Click on the App Launcher and select the object (Contact).
Upload files in Salesforce records
  1. In the Contact tab, select the record in which you have to upload the files.
  1. In the object record page, go to the section Notes and Attachments. Here, you can upload files by dragging and dropping or by clicking on the Upload Files button to browse and upload files.
Add Files to Salesforce object record page
  1. On successful file uploads, click on the Done button.
How to upload files in Salesforce records

Now, the uploaded files can be viewed and accessed from the Notes and Attachments related list of the record.

Add Files to object record in Salesforce

This way, we can upload files manually directly to the Salesforce object record page.

Upload Files in Salesforce Using Data Loader

In Salesforce, using the Data Loader, we can perform data operations like insert, export, delete, and update.

In the data loader, using the insert operation, we can upload attachments, such as images and documents, to the object record. This method is useful when you need to upload files in bulk for multiple records.

Ensure that you have installed the Data Loader in your system. Next, follow the steps below to upload files using the Salesforce Data Loader.

In this example, I will take an Account object record to upload multiple files to an account record.

  1. First, we will create a CSV file with the header columns ParentIdName, and Body. In the column ParentId, enter the ID of the record in which you have to upload attachments.

If you are unable to find the ID of the record, go to the Account (object), select the record, and then copy the 15-digit number starting from zero from the URL.

Upload Files in Salesforce using Data Loader

If you are uploading files to multiple records, then you can get the IDs of multiple records using the Data Loader export operation.

  1. Now, enter the copied ID in the ParentID column of the header. In the column Name, enter the type of files, like image, document, or PDF. In the Body column, we need to enter the path of the files where they are saved on our system.
How to Upload files to multiple records in Salesforce

Now, save the CSV file on your system to a location that the Salesforce data loader can access.

  1. Next, open the Data Loader and log in using Salesforce credentials. Then click on the Insert button for the data insert operation.
Insert Multiple files in Salesforce using data loader
  1. Activate the checkbox Show all Salesforce objects, then select the data object Attachment. Then select the created CSV file and click Next.
Use Data loader to Upload files in Salesforce
  1. Now, the data loader will initialize the uploaded file. Here, click OK to proceed.
Upload files using Data loader in Salesforce
  1. Map the data object fields with the CSV headers by clicking Create or Edit a Map. Then select Auto-Match Fields to Columns. If some fields don’t match, drag them manually in mapping. Once mapping is done, click OK and then Next to proceed.
Upload images and files using Salesforce data loader
  1. Select the location to save the success and error files of the import operation, from where they can be accessed later. At last, click on the Finish button.
Upload multiple files using data loader in Salesforce
  1. As we click on the Finish, a warning message will appear on the screen regarding the insert operation. Here, click on the Yes button to proceed.
  1. After the completion of the insert operation, we can view the success and errors that occurred during the operation. Here, click on the OK button to close the data loader.
Upload multiple files in Salesforce records

After this, navigate to the record in which you have inserted the attachments and go to the related list Notes & Attachments.

Salesforce data loader to Upload bulk Files

As shown in the above image, the files have been successfully inserted into the selected Account object record.

In this way, we can upload and insert files into the records using the Salesforce Data Loader by following the steps above.

Conclusion

In this Salesforce tutorial, we have learned how to upload files in Salesforce using both the manual method through the UI and the Data Loader for bulk uploads.

In the above examples, we learned how files can be added directly to object records, such as Accounts and Contacts. Then we also uploaded files to the Files object using the manual method. By following the above techniques, you can easily upload files for a single or multiple records to a Salesforce object.

You may also like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.