Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
9 months ago
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.
Aug 16, 2022 at 23:54
Nachiket Deshpande Nachiket Deshpande
2,148 4 4 gold badges 22 22 silver badges 51 51 bronze badges
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"
Aug 17, 2022 at 7:16
log in to answer this question.
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only