What does it mean to work with files in Salesforce? There are a number of things you might want to do:
Working with Files in Salesforce
Chatter feeds are messaging areas where you can collaborate with coworkers. Posting a file to a feed allows you to work together on it as a team.
Post your files to Chatter feeds
Some files are associated with records and should be kept together. For example, you might want to keep a non-disclosure agreement (NDA) with a customer’s account record by attaching it there. That way, users who have access to the account record can at least see the NDA. You may even grant them additional permissions – more on that later.
Attach your files to records
External users like your customers may need access to some of your files. You can share the files with them using the Salesforce cloud.
Share files via the Salesforce cloud
Your company may have its own file system. If you want a file accessible both through Salesforce and through an external file system, you can connect it there.
Connect your files to external file systems
If you want to check out how people are using a set of files, you can run a file report to view and analyze the data.
Analyze file usage through file reports
Files uploaded through the web interface may be up to 2 GB. Files uploaded through a mobile device may be up to 100 MB. It probably comes as no surprise that you may not want to work with huge files on mobile.
File access is guided by a set of different permissions on a file:
- View or preview
- Attach to a post
- Upload new version
- Edit details
- Change permission
- Make private
- Restrict access
A user’s relationship to a file drive which permissions the user holds for the file. Let’s go through them.
File Permissions by Relationship
The designated file owner has full permissions and can do whatever they like with the file.
A user admin with the “Modify All Data” permission enabled can do everything the file owner can do, unless the file resides in a private library. In that case, the admin has no access to it.
Administrator with “Modify All Data” Permission
A user admin with the “View All Data” permission enabled can view or preview the file, unless the file resides in a private library. In that case, the admin has no access to it.
Administrator with “View All Data” Permission
A user can become a “collaborator” on a file when the owner shares the file with them and chooses to grant them collaborator status. A designated file collaborator has the following file permissions:
- view or preview
- attach to a post
- upload new version
- edit details
- change permission
A “viewer” has the following file permissions:
- view or preview
- attach to a post
Viewers include groups and their members when the file has been posted to a group feed.
File sharing is a way to collaborate on a file with other users in your company (and therefore change the relationships of other users to a file). There are even ways to share files externally. To understand sharing, we’ll need to go through broad classes of sharing, file permissions related to sharing, user relationships to a file through sharing, and sharing actions you can take. Let’s tackle these one by one.
There are three broad classes of file sharing status: private files, privately shared files, and files shared with your company.
File Sharing Status
A private file hasn’t been shared with anyone except the file owner, or the owner has removed all its previous posts and shares. Some administrators may still be able view the file if they have the “Modify All Data” permission. I say “may,” because the file owner can prevent even these administrators from viewing the file by keeping it in a private library.
File metadata is not treated the same as the file itself, however. File metadata is not private even when the file is. File metadata, if you’re not familiar, is information about the file (e.g. its name and keywords), but not the file’s contents itself.
A privately shared file is a file that has been shared with specific people or groups. It may have been shared through Salesforce sharing, by creating a file link and sharing the link, posting the file to a feed on a record (as opposed to a public feed), or publishing it to a private library.
Privately Shared FileAdministrators with the “View All Data” or “Modify All Data” permission
can also find and view the file.
Files posted to public feeds that all users in your company can see are considered shared with your company. Like with the feeds themselves, all users in your company can view the file.
File Shared with Your Company
Files are shared or unshared through one of a set of file sharing actions. Let’s take them one at a time.
File Sharing Actions
This is also known as attaching a file to a record. When you want to associate a file with a record, this is the way to go. This is what we discussed above in Share Privately with RecordsAttach Your Files to Records.
When you share a file privately with an individual, you can decide whether to grant that individual Share Privately with IndividualsCollaborator
You can share a file with public or private groups in Chatter. When you share with a private or unlisted group, all members of the Chatter group become Share Privately with Chatter GroupsViewers
of the file and the file is considered privately shared. When you share a file with a public group, all Chatter users in your company become Viewers and the file is considered shared with your company.
In order to share a file with a content library, your admin must have this feature turned on for your org by enabling the setting “Files user interface allows sharing files with libraries.” The benefit of sharing a file with a library is that is it takes advantage of the permissions settings of the library you choose.
Share with Libraries
Files can also be shared by generating an encrypted URL link to the file and sending it to whomever you like. The link is public, so you can share a file this way with individuals both within and outside of your company, including customers and partners.
When someone clicks on the link, it opens a web-based version of the file. The file can then be viewed and downloaded, but link recipients are not Share via LinkCollaborators
After you’ve created a file link and sent it out, you can still delete it. Once you do, anyone who has received the link will no longer be able to access the file unless they’ve already downloaded it. And if you create a new link, it will be different from the previous one, so only recipients of the new link will have file access.
Sharing by link is enabled by default for most Salesforce orgs.
Once a file has been shared, the owner still has the ability to make it private again. In Salesforce Classic, this is a simple action you can take. If you choose to make a file private, it will be removed from any posts it’s attached to and from everywhere it’s been shared. If you’ve shared a link to the file in Chatter, the link is deleted.
There are three special cases to consider, however. First, files that originate in a Salesforce CRM Content Library won’t be removed from the library itself. Second, if the file was shared using a content delivery, the content delivery will survive when you make the file private, though it will be inaccessible.
If a file has been shared with a record, you can also make it private without un-attaching it from the record. If you do so, other users viewing the record won’t see the file even though it’s attached.
In Salesforce Lightning, making a file private is a manual process. You’ll need to remove any access granted, remove it from all Chatter posts, and delete any links you’ve created.
Users with the restrict access file permission on a file can turn off the ability for other users to share or un-share it. By default, anyone who can see a file can share it, so this will need to be explicitly invoked. Note, however, that it does not affect any sharing already made, only future attempts at sharing or un-sharing the file.
Prevent Others from Sharing and Un-sharing a File
You unfortunately can’t share a file unlimited times. The maximum is 100 shares, regardless of whether you’re sharing it with a record, a person, or a group.
If you’re running up against this limit, there are other strategies for collaborating on a file. You can create a public link to it and send it to whomever you like. Anyone with the link can download and view the file.
You can also post the file to your Chatter feed, which makes the file public to all Chatter users in your company.
Restrictions on Sharing
When working with files in Salesforce, you can upload new versions. Salesforce will track all versions of a file for you. When you upload a new version, it actually replaces the previous version as the active file, but all versions are still available if you need them.
Not everyone with access to a file can upload a new version. Only the file Who Can Do Itowner
, designated collaborators
, and administrators with the “Modify All Data” permission
can do so. But no matter who uploads the new version, the file owner will not change.
Salesforce can track many versions of the same file, but not an unlimited number. You can have up to 2,048 versions. If you’re hitting that limit, you’re in a select group indeed!
Restrictions on Versioning
Back to Top
Most data in Salesforce is stored as records in the Salesforce database for your organization (technically, Salesforce uses a multi-tenant architecture that uses a combined structure to store data from different organizations, but that’s a not how you experience it as a user). But some information you might want to store and share exists in files, and it probably doesn’t make sense to convert that information into fields in records. Thankfully, there are a number of ways you can work with your files in Salesforce.