问题
Trying to upload files upto 20 MB from Salesforce Visualforce page to another server. But when I select a file using apex:inputFile , it says file limit is 10 MB. Any idea about this ?
Already tried with transient variable
回答1:
Normal apex code has 6 MB heap (memory) size limit. Asynchronous apex (batch jobs, @future methods) have 12 and custom-coded inbound email handlers have 36. You won't be able to push more than that from server-side code. Even less if the file is binary and you might have to base64-encode it before sending.
Send email with attachments? Send from JavaScript instead of apex? Or change the direction, make the other system login to SF and retrieve files (up to 2 GB). Either make the other system check every hour or send them some notification msg that there are new files to pick up. Maybe even a Platform Event?
Or check if you can make a web mashup, display page from that 3rd party app in iframe for example.
https://help.salesforce.com/articleView?id=000321537&language=en_US&type=1&mode=1
https://trailhead.salesforce.com/en/content/learn/projects/workshop-platform-events/platform-event-define
来源:https://stackoverflow.com/questions/57872218/upload-20-mb-file-to-3rd-party-services-from-salesforce