0

I have some small place-keeper files (ContentDocument/ContentVersion) loaded by some existing code but want to replace the content with the actual PDF/Video data. This is to pre-load scratch orgs with some standard data that totals maybe 50 Mbytes spread across 20 files.

Does anyone have that working using e.g.:

sfdx force:data:bulk:upsert

with the binary data as base 64 in the CSV or the JSON equivalent? Or is there a better mechanism to use for this task of updating Salesforce Files?

PS

Just read in the Bulk API Developer Guide that:

Currently base64 fields are not supported in queries with the Bulk API.

Does that suggest base64 does work in updates?

4
  • How does Bulk API not supporting base64 fields in a query hurt your chances of upserting the document?
    – identigral
    Aug 4 at 17:01
  • Hi @identigral it doesn't was just suggesting that it implies that the upsert of base64 will work. But wondering about whether multiple MBytes are handled by this API and its SFDX wrappers?
    – Keith C
    Aug 4 at 18:48
  • 1
    You may have a look at SFDX Data Move Utility, it can handle File and Attachment, so maybe it works with ContentVersion. help.sfdmu.com/key-features Aug 5 at 12:13
  • 1
    Thanks @NicolasVuillamy - helpful.
    – Keith C
    Aug 5 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.