We are having a requirement where we get large attachments from external system REST API which includes large size attachments. I see salesforce can't handle this because of heapsize of 6MB sync and 12mb async. Is there any way to handle this scenario in apex. EDIT:

we get multiple large files in different formats [pdf env etc] with some other information of the order needed in salesforce from external system in form-data REST API. when the external system hits salesforce we need to save this files in a document management system [our company internal system] and save the Document unique id [Response from Doc management system] for that order in salesforce.

  • Host it on a different server and provide a link to the file instead of uploading the entire file would be one way. I say this because there's always going to be some sort of limit. We needed to upload files of up to 8 gigs and couldn't find a solid solution to store the files in Salesforce. – gNerb May 16 '18 at 16:02
  • 1
    They can directly upload using standard SF rest API, developer.salesforce.com/docs/atlas.en-us.api_rest.meta/… Best part it support mutipart form data. :) – Pranay Jaiswal May 16 '18 at 16:02
  • 1
    Even if you could work around the memory requirements, there's also a maximum amount of bandwidth you can use in a transaction. Without knowing exactly what you're doing, it's probably going to have to be an external service or a Visualforce page with a proxy or something. Consider an edit to explain what exactly you're doing. – sfdcfox May 16 '18 at 16:14
  • @sfdcfox : I have made an edit. thanks for the reply. I'm also looking if not possible in apex , what would be the other easy solution using another technology and integrate with salesforce. – shaan May 21 '18 at 16:00
  • 1
    @gNerb : Host it on a different server means we need the 3rd party tool sending docs to salesforce now should be sending it to different tool and save the documents and then the tool will send the document link to salesforce? is this what you guys did? Is my understanding right? – shaan May 21 '18 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.