First, you need to generate a base64 string that is sent to the Apex backend. Use the following function in your config_apex.js
file to achieve this:
Once you have your document's data converted, you can pass it to Apex. This snippet uses
Finally, you can use the below Apex code snippet to create a new ContentVersion record. This sample also links the newly created document to the sObject record you started from.
You can also find the full source code for an end to end flow in this Github repository.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales