
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.
Attachments — such as PDF files — may display as random text in Chrome rather than rendering the file content correctly. This occurs when the ContentType (also called the MIME type — Multipurpose Internet Mail Extensions) field on the Attachment record is missing or set to an incorrect value.
This behavior is not present in other Supported Browsers such as Firefox, Microsoft Edge (Chromium), and Safari, where the attachment opens without an issue.
This article explains how to identify and correct the ContentType value on existing Attachment records, and provides a workaround using Salesforce File Upload and Download Security Settings.
If PDF attachments are being inserted via custom code or a third-party package using the API, update the underlying custom code or contact the package vendor to ensure the attachment ContentType field is set correctly on insert.
The ContentType field must be set to the correct MIME type value at the time of creation. For PDF files, this value is application/pdf.
Common ContentType (MIME type) values:
For other file extensions, refer to Media Types. If you are unsure of the correct value, upload a sample file through the Salesforce User Interface and then check its corresponding ContentType value after upload.
For existing Attachment records that are already affected, perform an update operation via the Attachment object API using Data Loader or another API client tool to correct the ContentType field values.
After updating affected attachment records, users may need to clear their browser's cache, or verify the attachments are opening properly using Chrome's Incognito mode.
Note: Custom code, integrations, and third-party application vendors must ensure ContentType values are set with the correct MIME type on insert or update of Attachment records via the API.
If it is not possible to update custom code, and the attachment upload needs to be fixed by a third-party vendor, a Salesforce Administrator may use Configure File Upload and Download Security Settings to set the download behavior for each affected file type to 'Hybrid'. This forces Salesforce to download the file rather than render it within the browser.
If none of these options are applicable, please log a case and ask Support to refer to the Internal Information section of this article to discuss potential options.
Content Type field is not populating when an attachment from the Notes and Attachment related list is added
Enable or Disable Winter ‘20 Permissions Changes for a B2B Commerce Storefront
Improve Org Security With Correct File Extensions and MIME Types
000381189