You need to sign in to do that
Don't have an account?
Mitul Thumar
Using Apex Rest API Send files/Attachment to third party.
Hello All,
Can we send file/Attachment data to a third party using Apex rest api if the file/attachment size is bigger, more than 12MB?
Working fine for less than 12MB.
We have many files/attachment are more than 12MB and we are facing salesforce limitation.
Open for any discuss or any suggestion are welcome.
Thanks
Mitul
Greetings!!
Normal apex code has a 6 MB (memory) or heap size limit. If you are using the Asynchronous apex (i.e batch jobs, @future methods) these have a 12 MB limit size and custom-coded inbound email handlers have a 36 MB Limit size.
You won't be able to push more than that limit size from the apex code. Even if the size is less or if the file is binary and you might have to base64-encode it before sending it through API.
To send more than 12MB files, you have to encode the base64 data into a BLOB.
You can send the encoded BLOB using Rest API.
example- If this helped you please mark it as the best answer.
Thanks and Regards
Suraj Tripathi