Opening a document from the Salesforce Database
If you have a document uploaded into your instance of Salesforce, it will have a record in the database in the ContentVersion table. The ContentVersion object allows for versioning of the ContentDocument which is linked to a Salesforce record via the ContentDocumentLink.
When working with Salesforce files that are 25 MB or larger, attempting to load the file’s VersionData will trigger an Apex memory error. To avoid this issue, you have two options:
Store the files externally in a system like Amazon S3
Use a proxy server to retrieve large files directly from Salesforce
In this guide, we’ll focus on the proxy server option.
Process Flow

ContentVersionController.cls
ApryseWvInstance.js
config_apex.js
Proxy
This is a sample proxy server using express.
Converting a base64 string to blob inside your WebViewer LWC
Code sample
You can find a full code sample that implements opening documents in Salesforce on our Github repository.
Last updated
Was this helpful?
