+ Start a Discussion
Anuj Joshi 16Anuj Joshi 16 

Files import and export using Data Loader

Hi,

There is an standard object called File. If i want to import and export files in the file object using data loader i cannot do it because File object is not there in the list in Data Loader. Please tell me how to export and import files.
NagendraNagendra (Salesforce Developers) 
Hi Anuj Joshi,

The file object represents the records stored in User's chatter and Content Files.

It supports all file types up to 100MB each. You can share files here with Chatter or by creating groups. You also have a private section so no other users in the Salesforce CRM system can see them. The Files tab requires no admin setup and is ready to use when Chatter is enabled. Since this integrates with Chatter and Content, think of this as a central repository where all files from those two can be accessed if you have the proper permissions.
 
You can store the document in myFiles using API as well. You need to store the content as content document in personal workspace and provide ‘origin’ field in content version object as ‘H’. (origin is a picklist field in content version object and has two values ‘C’ and ‘H’. C denotes the file is in users personal workspace and ‘H’ denotes Chatter files from User’s myFiles.). This will insert the document in myFiles.
 
You can also share the file later on with any record by posting the file into content of the record by using contentPost.

If you want to import and export data into any of the sobjects please refer to the below links

Data import using Data Loader:http://dataloader.io/importing-data-salesforce

Data export using Data Loader:http://dataloader.io/exporting-data-salesforce

Please mark it as solved if it helps you.

Best Regards,
Nagendra.P
Anuj Joshi 16Anuj Joshi 16
Hi,

I know this but when i am exporting data from attachment object with fields Parent ID, File Name and Body. I am getting the file but when i edit the body and give the path of file in the system it is showing error while inserting.
Anuj Joshi 16Anuj Joshi 16
Hi,

I want to export only files but I can't because file object is not present in data loader. The above point does not solve my issue.

Regards,
Anuj
Herman p NgHerman p Ng
Hi Anuj,
In case you haven't figured out.
This one is tricky, Files is the ContentVersion object

Regards,
Herman
MiddhaMiddha
Try using this tool to extract files/contents/documents from Salesforce. 

http://www.sfdctimes.com/export_sfdc_files/
Johan KarlsteenJohan Karlsteen
I faced this problem yesterday so I ended up writing a Python script for it, wrote a post about it:
https://johan.karlsteen.com/2018/07/03/exporting-salesforce-files-aka-contentdocument/

Code is available here:
https://github.com/snorf/salesforce-files-download

Probably bugs everywhere so don't hesitate to contact me if it doesn't work
Clint MajorsClint Majors
Johan - Your solution worked for me. Thanks for sharing the code! I had a lot of files to download so I modified the script to batch the ContentVersion queries, used a config file to store my connection info, and added a csv output file to map the custom object ids to file ids. 
pratap murukutla 17pratap murukutla 17
Clint Can you please share the code or provide the idea elaborate. I am having less knowledge on Python. I believe when you mention batch the content version queries meaning a script running query on different ids one by one and you used csv output file to get the ids one by one. Am I correct?