Loading

Working with Public Files

Publish Date: Apr 22, 2025
Description

Salesforce Files can be used to share information both internally and externally. This document will explore three methods for making files accessible to the public: Content Deliveries, Asset Files, and Experience Cloud (previously Community Cloud).

Content Deliveries

Set Up Content Deliveries (salesforce.com)

 

Content Deliveries allow you to create a public link to a File. This can be a good alternative to attaching files to an email because it provides some control over the recipient’s access (such as if they can download the file or not, as well as how long they can access the file) and also provides tracking (when the link was viewed). These are not CDN Cacheable, and generally should not be used for hosting public content on a website.

 

In the Lightning UI, a public link can be created but it doesn’t provide access to the options. These links can be created with all options available through the ContentDistribution API.

 

Content Deliveries have a limit of 50,000 views per day, or 50 GB bandwidth consumed, as documented in our Salesforce CRM Content Limits. For higher expected consumption, consider using Content Assets or Experience Cloud as applicable.

 

Content Deliveries can be used with any file type and file sizes up to 2 GB.

 

It's important to note that public links for file sharing in Salesforce are subject to usage limits to prevent abuse. These limits, which include HTTP rate and bandwidth restrictions, can result in images failing to load during periods of high traffic. Furthermore, public links do not utilize CDN caching, which can negatively impact performance. They are also not suitable for use directly within `<img>` tags, as they do not provide a direct image data stream.

Asset Files (also called Content Assets)

Asset Files are an alternative to using Static Resources. Similar to Static Resources, they provide a way to make files publicly accessible and CDN Cacheable. One use of Asset Files is while developing custom components. Here is an example of how to access them in a Lightning Web Component. Another use is for branding, such as making a company logo public.

Unlike Content Deliveries, Asset Files do not have a daily view or download rate limit. Asset Files can be up to 2GB in size however they are limited to 25 MB when being used in a package. These are the supported file types:

  • ASF

  • AVI

  • AAC

  • BMP

  • CSS

  • CSV

  • GIF

  • JAR

  • JPEG

  • JS

  • M4A

  • M4V

  • MOV

  • MP3

  • MP4

  • MPEG

  • PDF

  • PNG

  • RTF

  • SVG

  • TEXT

  • WAV

  • ZIP

  • Microsoft Excel Formats

  • Microsoft Word Formats

  • Microsoft PowerPoint Formats

If the asset file is made public (isVisibleByExternalUsers is true), the URL format is:

https://<my_domain>.my.salesforce.com/file-asset/<asset_name>?oid=<organization_Id>

Experience Cloud

Experience Cloud enables you to create websites that can either be seen by the authenticated customer or partner users, or unauthenticated guest users. In general, files made accessible through an Experience Cloud site follow similar access control as files made available to internal users: what entities they are shared with control access.

 

More details are documented here: File Visibility and Sharing in Experience Cloud Sites (salesforce.com)

 

Below are a few ways files can be made available to authenticated or unauthenticated users with some considerations for each approach:

  • A file can reside in a Content Library where and users who are members of the library will have access to the file

    • Only Customer Community Plus and Partner Community users can be members (Customer Community can’t be)

    • A file in a library can be shared with an Experience Cloud site itself, granting access to the file to anyone who can access the site (both authenticated or unauthenticated users)

  • A file can be uploaded to a Topic, Chatter Group, or User Profile within an Experience Cloud Site

    • This will make the file available to all users who can access the record

      • Topics are typically available to all users who access the site

      • Chatter Groups can be either public or private to control access

      • User sharing within a site controls who can see which users

    • Regardless of where the file was uploaded initially within the site, there is an option to share it directly to the site to ensure all users who can access the site can access the file

  • A file can be shared with Salesforce Records (such as accounts, cases, or custom objects)

    • When shared with a record, you can control whether a file is available only to internal users who can access the record, or also to external users who can access the record, by setting the customer access

    • The record needs to be accessible by the user for the file shared with the record to be accessible

    • Here’s a blog post with details of how to share the file using Salesforce Knowledge

    • If you need to make the file available to unauthenticated users, review our best practices to improve security

Salesforce CMS

Salesforce CMS doesn’t use Salesforce Files. Salesforce Files uses the ContentDocument entity and Salesforce CMS uses ManagedContentDocument. Salesforce CMS is meant for managing content for digital channels, such as websites, emails, and mobile applications. While you can model content such as News Articles or Blog Posts in CMS, you also can manage media such as Images and Documents.

 

Unlike Salesforce Files, Salesforce CMS isn’t associated with records. Content, including media, managed in Salesforce CMS can be published to Experience Cloud Sites, made public using a public using Public Channels (which also allows you to serve content using our out-of-the-box CDN), or enabled for specific users, including API users through Restricted Channels.

 

Files could be made public by publishing them to a Public Channel, or to a public Experience Cloud site. Through either option, the files can be served by a CDN.

Knowledge Article Number

004652690

 
Loading
Salesforce Help | Article