You need to sign in to do that
Don't have an account?
Shyamala Varadharajan
How to download file through REST API in which size is more than 15 MB
Hi All,
In LWC screen I have a Export button where on click of that button I'm making an API callout(Synchronous Call). In response I'm getting size more than 25 MB. How to handle this as the size is very huge. Please help.
In LWC screen I have a Export button where on click of that button I'm making an API callout(Synchronous Call). In response I'm getting size more than 25 MB. How to handle this as the size is very huge. Please help.
- You can use the HttpResponse method getBodyAsBlob to fetch the response as a file. In Async mode, this has a limit of 12 MB.
- Get the authentication done in apex and using the access token do the callout from Javascript where these limits won't apply.
For more details please refer to the below links.https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_api_calls_platform.htm
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm
Please mark it as Best Answer if the above information was helpful.
Thanks.
Thank you so much for the response. even if I use the getBodyAsBlob method and change it to async , if the size of the file goes more than 12MB then again its an issue. Is there any other work around for this?