File download behavior

Salesforce enables you to define how attached files are handled when a user wants to interact with them. Three options are offered:

  • Download: when the user selects the file, it is downloaded to their computer

  • Execute in browser: when the user selects the file, it is executed in the browser. Due to potential security risks, this option is not available to all file types, and it is not always possible to execute all file types in all browsers.

  • Hybrid: Salesforce files are always downloaded. Other attached files and document records execute in the browser.

When reviewing and changing these options, bear in mind settings in other programs can override Salesforce file download behavior: 

  • Browsers can execute PDF files. Even if you set PDFs to download, browsers can still open them.

  • Microsoft Edge browser has an option to automatically open Office files (Word, Excel, Powerpoint, and so on) in Edge.

  • Firefox browser has settings for the user to define which file types are opened in browser and which ones are downloaded.

  • Where files are hosted can impact download behavior. Online hosting providers such as Google Drive or Dropbox can display common file types in the browser.

To define the default settings to your org: 

  1. Go to Setup > Settings > Security > File Upload and Download Security.

  2. Review the default settings.

  3. To change settings, select Edit.

  4. For the file type you want to change settings, select the picklist in the Download Behavior column and choose an option.

  5. Select Save.