3

Background :

Our users are uploading large contract files to account and we use Email2Case for case management, customer respond with a lot of documents. This is eating up our file storage limit in Salesforce very quickly.

In order to address this problem, IT Manager has asked us to implement a process to offload Salesforce files to S3 storage and delete documents from Salesforce and create an LWC component for users to access those files.

Question:

Has anyone faced a similar challenge? Is it even a proper way to approach this problem by offloading files to external file storage to save space? Would there be any challenges or issues if we go ahead with this approach?

3 Answers 3

6

Has anyone faced a similar challenge?

Sure. Salesforce storage has always been known to be relatively expensive compared to mass storage services like Google and Amazon, so using a cost-effective storage and distribution system makes sense.

Is it even a proper way to approach this problem by offloading files to external file storage to save space?

It is a proper way to do so. For example, in a previous role, we did this so we could have the files uploaded in Salesforce as part of a custom app we built, and the files were pushed to S3 so they could eventually be served to the public.

Would there be any challenges or issues if we go ahead with this approach?

Compared to storing data in Salesforce directly, there's not much difference storing it elsewhere.


In the ContentVersion object, which is where files are stored, one option is to provide a URL ("ContentUrl"); this allows the system to provide links to externally hosted files.

You don't even need any custom UI code (LWC, Aura, Visualforce), as this is a standard object that you can just put directly onto a page layout (the Files related list), and you can even send the files to S3 via triggers that call asynchronous methods to move the files.

You could also reverse this by having a server running on EB, Heroku, or something else that listens for new files and then moves them to S3. This could be done with a simple Streaming API connection (e.g. Change Data Capture).

3
  • 1
    @sfdxfox Thank you for your detailed answer.
    – Danny
    Commented Jan 13, 2022 at 19:14
  • @sfdxfox Is there a way to show preview of those links to externally hosted files? I tried myself but SEEMS like not possible.
    – compski
    Commented Apr 22 at 9:05
  • @compski I don't think it's possible out of the box, as the file preview feature in Salesforce renders the preview, which isn't possible for external files.
    – sfdcfox
    Commented Apr 22 at 11:26
0

This seems like an exact solution to our challenge. Can you elaborate on how you solved for the file upload piece?

Were you able to leverage Salesforce built-in file upload UI or did you need to develop a custom UI for adding files and their record associations to Lead, Account, etc.

2
0

This is an excellent approach to solve the Salesforce file storage issues; you can upload your Files/Attachments into Amazon S3 to save on file storage.

The options we have are

  1. Either custom build a solution to migrate/upload your files to Amazon S3 directly when uploaded from/via Salesforce or
  2. Install & Use an existing AppExchange app that does the same. This option is a more efficient, scalable, and easy-to-deploy option. I strongly recommend Satrang [Drag, Drop & Upload Files to Amazon S3 AppExchange App][1]

This app helps you to

  1. Upload new files directly to Amazon S3, with the link (not the actual file) stored in Salesforce.
  2. Download and Delete files directly from Salesforce, which in turn does the same from Amazon S3
  3. With this app, you can also migrate your existing (or new) Files/Attachments from Salesforce to Amazon S3 without writing any code. During this process, you can turn on a setting to auto-delete files/attachments after migration.

Disclaimer: I work at Satrang Technologies, the publisher of this Satrang Drag, Drop & Upload Files to Amazon S3 AppExchange App.

Satrang Drag, Drop & Upload Files to Amazon S3 AppExchange App URL: https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3000000B5ZPqEAN&channel=recommended&tab=e

You must log in to answer this question.

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