Upload Files and Links with Data Loader
Use Data Loader to bulk upload files and links into Salesforce.
Before uploading documents or links, note the following.
-
If you intend to upload with Bulk API, verify that
Upload Bulk API Batch as Zip Fileon the Settings | Settings page is enabled. -
When you upload a document from your local drive using Data Loader, specify the path in the
VersionDataandPathOnClientfields in the CSV file.VersionDataidentifies the location and extracts the format, andPathOnClientidentifies the type of document being uploaded. -
When you upload a link using the Data Loader, specify the URL in
ContentUrl. Don’t usePathOnClientorVersionDatato upload links. -
If you’re updating content that you’ve already uploaded:
- Perform the Insert function.
- Include a
ContentDocumentIdcolumn with an 18-character ID. Salesforce uses this information to determine that you’re updating content. When you map theContentDocumentId, the updates are added to the content file. If you don’t include the ContentDocumentId, the content is treated as new, and the content file isn’t updated. Visit ContentDocument to learn more.
-
Create a CSV file with the following fields.
Field Description TitleThe file name Description(Optional.) The file or link description. If there are commas in the description, use double quotes around the text. VersionDataThe complete file path on your local drive (for uploading documents only). Files are converted to base64 encoding on upload. This action adds approximately 30% to the file size. PathOnClientThe complete file path on your local drive (for uploading documents only). ContentUrlThe URL (for uploading links only). OwnerId(Optional). The file owner, defaults to the user uploading the file. FirstPublishLocationIdThe library ID. RecordTypeIdThe record type ID. To determine the RecordTypeIdvalues for your organization using Data Loader, follow the steps in Exporting Data. The following is a sample SOQL query:Select Id, Name FROM RecordType WHERE SobjectType = 'ContentVersion'TagsCsvOptional tag A sample CSV file is:
-
Upload the CSV file for the ContentVersion object (see Insert, Update, or Delete Data Using Data Loader). All documents and links are available in the specified library.