function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nagendra Ananda 17Nagendra Ananda 17 

Maximum file size upload through custom REST API

Hey - Has anyone implemented file uploads to Salesforce Files through Custom Rest Webservice, if yes can you please let me know the max file size upload. I am getting System.LimitException: JSON string exceeds heap size limit\n\nExternal entry point" when tested through postman for a file size of 4 MB.

Appreciate any help on this.

Thanks
 
Raj VakatiRaj Vakati
Using the SObject Basic Information or SObject Rows APIs, the maximum file size for uploads is 2 GB for ContentVersion objects and 500 MB for all other eligible standard objects. Using the SObject Collections API, the maximum total size of all files in a single request is 500 MB.



https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm

https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_input.htm
https://help.salesforce.com/articleView?id=collab_files_size_limits.htm&type=5

https://salesforce.stackexchange.com/questions/219877/correct-approach-uploading-file-using-rest-api-file-size-100-mb
Nagendra Ananda 17Nagendra Ananda 17
The above limitations are for the standard API, I am looking specifically to custom REST API. Any help, please.

Thanks