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
mahesh pasupuleti 4mahesh pasupuleti 4 

Correct approach uploading File using REST API (file size 100 MB)

Looking for best REST API to upload a file to a record with at least file size 100MB?
 
I have created custom REST API handles POST call, inserts both ContentVersion, ContentDocumentLink records (Base 64 content in request body) manually. But using custom API not able to upload(not able to test) file size more than 23 MB.
 
other way using with standard salesforce REST API, (/services/data/v35.0/chatter/feed-elements)issue is, It's not supporting Base 64 binary data conversion to normal format..

But in salesforce developer guide docs, mentioned that file size limit to upload REST API is 2 GB.
(Copied same lines, links from the articles).
 
  • maximum file size for uploads is 2 GB for ContentVersion objects”,
  • To upload a binary file up to 2 GB (including headers) ”,
  • “Salesforce CRM Content
  • Content and Libraries tabs in Salesforce Classic
  • 2 GB
  • 2 GB (including headers) when uploaded via Chatter REST API
  • 2 GB (including headers) when uploaded via REST API

 
 
 
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
 
 
Let us know if you worked on the requirement “Upload file to record using REST API (file size should support atleast 100 MB)”
 
mahesh pasupuleti 4mahesh pasupuleti 4
It would great if help on this,
chatter API (Salesforce REST API) : /services/data/v35.0/chatter/feed-elements. accepts Base64 encoded binary data for upload file content.
But it's not coverting or decoding back to normal format.. 
how it could be handle encoding & decoding file using thie standard REST API.
Rick Fleischmann 7Rick Fleischmann 7
Do you have an example of the code to upload a file using REST in c#? I can do an Attachment to an object (account, opportunity, etc.), but I don't know how to upload to a File to an object.
John DrewJohn Drew
Rick, were you able to upload a file (not an attachment) using c#?