Newer Version Available
Upload Attachments
Use Data Loader to upload attachments to Salesforce.
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer editions |
Before uploading attachments, note the following:
- If you intend to upload with Bulk API, verify that Upload Bulk API Batch as Zip File on the page is enabled.
- If you are migrating attachments from a source Salesforce org to a target org, begin by requesting a data export for the source org. On the Schedule Export page, select Include Attachments to include the Attachment.csv file in your export. You can use this CSV file to upload the attachments. For more information on the export service, see Export Backup Data from Salesforce.
- Confirm that the CSV file you want to use for attachment
importing contains these required columns. Each column
represents a Salesforce field.
- ParentId—Salesforce ID of the parent record
- Name—Name of the attachment file, such as myattachment.jpg
- Body—Absolute path to the attachment on
your local driveMake sure that the values in the Body column contain the full path of the attachments on your computer. For example, if an attachment named myattachment.jpg is the folder C:\Export, Body must specify C:\Export\myattachment.jpg. Your CSV file looks like this example:
1ParentId,Name,Body 250030000000VDowAAG,attachment1.jpg,C:\Export\attachment1.jpg 3701300000000iNHAAY,attachment2.doc,C:\Export\files\attachment2.doc 450030000000VJowBBG,attachment_word_document.doc,C:\Export\attachment_word_document.doc
The CSV file can also include other optional Attachment fields, such as Description.
- Proceed with an insert or upsert operation (see Insert, Update, or Delete Data Using Data Loader). For the select data objects step, select Show all Salesforce objects and the attachment object name in the list.