Steps to import attachments using Apex Data Loader are
- Create an AttachmentLst.csv file with the following column headers:
ParentId - ID of the record to which the attachment should be associated
Name - Name of the attachment
ContentType - Format of the extension (e.g. .xls, .pdf, etc)
OwnerID - ID for the owner of the attachment
Body - File path to the Attachment on your local machine (C:\Attachments\FileName.jpeg)
- Log in to the Data Loader.
- Select the "Insert" command.
- In the 'Select Sforce Object' step, select the ‘Attachments’ object. This object is not displayed by default hence check the ‘Show all Sforce Objects' checkbox.
- Choose the AttachmentLst.csv file.
- In the mapping step, map the following fields:
Body - Make sure to map the Body column which you created previously with the file extension. This is how you designate the file and location of the attachments to be inserted.
7. Click "OK" to start the upload.