0

I am able to send files up to 4.5 MB from salesforce using an HTTP request to AWS s3 bucket. How can we send files as large as 50 MB from salesforce using HTTP request?

1 Answers1

0

You need to reverse the flow. Apex has 6 MB RAM limit (12 MB if you use async apex, 36 MB if it's inbound email handler). 50 MB * 133% (base64-encoding of binary payload) = 66.5 MB, way over the limit.

Send some notification (custom callout? Platform event?) to other system, make it log in and pull the file using standard APIs, without invoking custom code and worrying about limits. In the message you could send them the REST API download URLs ({instance.my.salesforce.com}/services/data/v50.0/sobjects/ContentVersion/068.../VersionData), if they access this in REST API they'd get binary payload in response. If they'd rather have it base64-encoded - SOAP API query of this field in ContentVersion table might work better.

See upload 20 mb file to 3rd Party services from Salesforce and https://stackoverflow.com/a/56268939/313628

eyescream
  • 18,088
  • 2
  • 34
  • 46