I have 40k PDF's in windows shared drive. Each pdf should be attached to parent account. The name of each pdf is an external ID in salesforce. e.g AA123.pdf corresponds to AccountRecordId '0015C00000OaTWhQAN' AA456 corresponds to AccountRecordId '0015C00000OaRWhAVN'

My question is when i prepare my csv to be uploaded via Dataloader, how can i get the path of each pdf without having to type the path ?

e.g path of AA123.pdf is S:\IT\Database\Attachments\Extracts\AA123.pdf

Is there any utility program or do i have to write a script that will go through each pdf in the folder, extract the absolute path and create a csv. ?

  • does my answer solve your issue?
    – ytiq
    Commented Jan 18, 2020 at 13:04

1 Answer 1


When you upload Files there is "PathOnClient" field I think, you specify it and DataLoader will use it as a location for a file. You upload those files as ContentVersion and then to link them with the account you separately upload ContentDocumentLink records. Keep in mind that you can upload ~100k Files a day enter image description here enter image description here

P.S. after you upload files result "success" file should contain Ids and Names for your files, so there should be no problem for generating upload file for ContentDocumentLink

  • I think I did not pose my original question correctly. The .csv that i need to upload should have the path of each of the attachments. I would like to automate the creation of csv file. i.e one column will have the name if the file and other will have the path of the file. Commented Jan 20, 2020 at 15:19
  • Do you have your files on your computer that you want to upload?
    – ytiq
    Commented Jan 21, 2020 at 7:46
  • yes I have the files on my computer that i want to upload Commented Jan 23, 2020 at 22:44
  • So you specify pass to them in your CSV file and this path info into PathOnClient
    – ytiq
    Commented Jan 24, 2020 at 13:08
  • I don't quite understand what you mean. Commented Jan 24, 2020 at 15:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .