Loading

Attachment does not open properly in Chrome browser

Data pubblicazione: Sep 20, 2024
Descrizione
After the Winter 20 release when users attempt to open attachments, such as PDF files, using Chrome they will see random text instead of the file content in the browser.

This same behavior is not present in other Supported Browsers such as Firefox, Microsoft Edge (chromium), and Safari, and the attachment opens without an issue.

 
Risoluzione

If PDF attachments are being inserted via custom code or a third-party package via the API for example, please update the underlying custom code or contact the package vendor to set the attachment ContentType field = application/pdf in the package's code.

For existing affected attachment records, ensure their ContentType field values are correct and perform an update operation to the affected Attachment object records via the API and Data Loader or other client tool.

 
  • PDF = application/pdf
 
  • JPG = image/jpeg
 
  • ZIP = application/zip
 

Note: 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.


This problem can also occur for other attachment file types or extensions and for valid ContentType values.  For different file extensions, refer to Media Types. If you're unsure, you can also upload a sample file via the User Interface and then check its corresponding ContentType value that's set after upload.

Custom code, integrations and third-party application vendors need to ensure ContentType values are set with the correct MIME on insert or update of Attachment records via the API.

If it's not possible to update custom code, the attachment upload needs to be addressed by a third-party vendor to fix. An Admin may Configure File Upload and Download Security Settings and set download behavior for each affected file type to 'Hybrid' so it forces Salesforce to download a file rather than render it within the browser as a workaround.

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.

Numero articolo Knowledge

000381189

 
Caricamento
Salesforce Help | Article