Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
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? – Poet Feb 17 at 11:44

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.

share|improve this answer
    
Update from VF page you can upload file of 25 MB. – Tushar Sharma Feb 17 at 11:47
    
Are you sure? Do you have a resource? I could only find what I'd originally linked and this? – Poet Feb 17 at 11:49
1  
create new attachment and directly upload in attachment. It will allow you to save 25 MB file. :) – Tushar Sharma Feb 17 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 yesterday
    
@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. – Tushar Sharma 15 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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