[英]How to upload large files from salesforce to third party?
I am able to send files up to 4.5 MB from salesforce using an HTTP request to AWS s3 bucket.我可以使用 HTTP 请求从 salesforce 向 AWS s3 存储桶发送最大 4.5 MB 的文件。 How can we send files as large as 50 MB from salesforce using HTTP request?
我们如何使用 HTTP 请求从 salesforce 发送大至 50 MB 的文件?
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).
Apex 有 6 MB RAM 限制(如果使用异步 apex,则为 12 MB,如果是入站电子邮件处理程序,则为 36 MB)。 50 MB * 133% (base64-encoding of binary payload) = 66.5 MB, way over the limit.
50 MB * 133%(二进制有效负载的 base64 编码)= 66.5 MB,超出限制。
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.向其他系统发送一些通知(自定义标注?平台事件?),使其登录并使用标准 API 拉取文件,而无需调用自定义代码并担心限制。 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.在消息中,您可以向他们发送 REST API 下载 URL(
{instance.my.salesforce.com}/services/data/v50.0/sobjects/ContentVersion/068.../VersionData
),如果他们在 REST API 中访问它他们会得到二进制有效载荷作为响应。 If they'd rather have it base64-encoded - SOAP API query of this field in ContentVersion
table might work better.如果他们更愿意使用 base64 编码 -
ContentVersion
表中此字段的 SOAP API 查询可能会更好。
See upload 20 mb file to 3rd Party services from Salesforce and https://stackoverflow.com/a/56268939/313628请参阅从 Salesforce和https://stackoverflow.com/a/56268939/313628将 20 mb 文件上传到第 3 方服务
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.