2

I am trying to implement upload files to Custom object's record through Visualforce and Apex.

I have enabled FeedItem for the object. I am using Blob as file type but Visualforce is not allowing me to attach file more than 10 MB.

While I am using chatter:feed entityId="{!Document.Id}" component in VF page, its file option allow me to upload more than 50 mb file.

What I have to do, so that Visual force should provide similar functionality as Chatter File and allow me to upload at least 50 MB file .

2 Answers 2

1

You can't do this via Visualforce - the limit is clearly documented at:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputFile.htm

Note: The maximum file size that can be uploaded via Visualforce is 10 MB.

You should be able to upload larger files via the REST API. The forcetk should help you in this situation too. For an example that uploads a photo via REST, check out Pat Patterson's blog post:

https://developer.salesforce.com/blogs/developer-relations/2013/11/uploading-photos-to-chatter-files-with-html5.html

0

With the use of chatter Rest API I am able to upload upto 500 mb. Below is the snippet of code I used.

XHR.open('POST', '/services/data/v34.0/chatter/feed-elements'); //add headers 
XHR.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
XHR.setRequestHeader('Authorization', 'Bearer ' + __sfdcSessionId); 
XHR.setRequestHeader('Accept', 'application/json'); 
0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.