8

Is it possible to upload the files with size more than 25MB and can we show them in related list of a custom object? what is the best way to achieve this? Do we need to use external storage if the size limit crosses 2GB limit? can we upload the files via VF page?

3 Answers 3

9
+200

Yes you can do this using chatter. Check here Upload a File as Large as 2GB in Salesforce Using a Visualforce Page

Basically what you need to do here is include chatter component in the VF page and then using some CSS display it and attach file of 2 GB.

<chatter:feed entityId="<ID of the custom object record>" />

Now some CSS and javascript

$('.uploadFileSizeLimit').hide();           

$('.contentPublisherSlideDown.customPanel.alignTop').css('border', '0');

$('.clearContentPanelButtonContainer').hide();

$('.publisherFeedItemTypeChoices').hide();      

$('.cxfeedinnerwrapper').hide();  

$('.publisherBottomBarPlaceholder').hide();

$('.publisherTextAreaPlaceholder.alignCenter').hide();

And

if($('.file')[1].files.length > 0){

                   $('#publishersharebutton').trigger('click');

}else{

                   alert('Please select a file');

}

Your icon look like enter image description here

But if you want to upload more then 2 GB in single shot then you need external server(Drive, Dropbox) for this.

2
  • 1
    Clever way of using VF and Chatter. I'd imagine it'd also be possible to use REST or SOAP in Visualforce as well?
    – Dan Jones
    Commented Feb 17, 2016 at 11:44
  • @DanJones - REST - may be, but definitely NOT with SOAP. There is something called SOAP streaming of large files, but NOT many SOAP servers supports that functionality.
    – Bhuvan
    Commented Apr 20, 2017 at 0:00
6

Here's a resource.

The following are maximum file size limits for files in Salesforce CRM Content:

  • 2 GB
  • 2 GB (including headers) when uploaded via Chatter REST API
  • 2 GB (including headers) when uploaded via REST API
  • 38 MB when uploaded via SOAP API
  • 10 MB for Google Docs
  • 10 MB when uploaded via Visualforce

So to answer your questions:

Is it possible to upload the files with size more than 25MB and can we show them in related list of a custom object?

Yes.

what is the best way to achieve this?

As Tushar said, Chatter would be one way, otherwise you'd want to look at using the REST API for large file sizes.

Do we need to use external storage if the size limit crosses 2GB limit?

Yes. You'd probably want to look at other solutions (SharePoint, OneDrive, Google Drive, Dropbox etc...).

can we upload the files via VF page?

Yes, but only to a 10Mb limit.

Or you can do as Tushar says by uploading directly to the Attachment object:

create new attachment and directly upload in attachment. It will allow you to save 25 MB file.

5
  • Update from VF page you can upload file of 25 MB. Commented Feb 17, 2016 at 11:47
  • Are you sure? Do you have a resource? I could only find what I'd originally linked and this?
    – Dan Jones
    Commented Feb 17, 2016 at 11:49
  • 1
    create new attachment and directly upload in attachment. It will allow you to save 25 MB file. :) Commented Feb 17, 2016 at 11:59
  • @TusharSharma Actually, there's a memory limit (heap), so no, you can't upload a 25MB file in Visualforce. You need to use the API for files above the heap limit.
    – sfdcfox
    Commented Jun 23, 2016 at 20:25
  • @sfdcfox I have tested this many time and still using. Just create new attachment instance and save the record and use pagerefernce type method and return to another page or reload same page. You can easily save the record. Commented Jun 24, 2016 at 6:06
0

You can use Salesforce Content object to store large file size and use it as related list

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .