0

We are facing challenge to upload large files in Salesforce. (We are using LWC component to upload file).

  • Client Payload Data Limit is 4 MB

  • Files are uploaded in Base-64 encoded format, which limits the file to about 3 MB in total (minus protocol overhead for calling a server method).

  • We are passing file content to Apex as string where Heap size comes into play limit is 6MB in synchronous and 12MB in async.

How to overcome this challenge ? any suggestion would be greatly appreciated, we are thinking to use Blob and I was going through this article Insert or Update Blob Data

Please advise whether this will solve the challenge to overcome the 3MB limitation or anything else that can help us.

1 Answer 1

1

Do you want to store the file or parse it ? You need to chunk the file and send the chunks one by one to Apex. Appending to content version however may give issues for Apex heap size in this case but you can parse the file with this approach correctly. For storing the file please leverage the lightning file upload in lwc which can be used to upload 2gb of file.

<lightning-file-upload label="Upload New File" name="fileUploader" accept=".csv"
     record-id={recordId} onuploadfinished={handleUploadFinished}>
</lightning-file-upload>

You must log in to answer this question.

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