A client has an existing integration that runs daily, which calls a 3rd-party system to generate a report on new opportunities; the generated report is added to the Oppty as an Attachment, as an HTML document. Previously, clicking the "View" link (e.g.,
https://c.naXX.content.force.com/servlet/servlet.FileDownload?file=00P1A00000abc01) would display the HTML document in-browser, in a new tab. The client's org received the Spring 16 release over the weekend, and now clicking the "View" link on one of these HTML attachments automatically downloads the file. I do see a response header in the http reply which is likely causing the behavior:
Content-Disposition:attachment; filename="e-renter Report"
While I don't have a captured session from before the release for comparison, I have to believe this is a new behavior.
I've looked through the release notes, and cannot find direct reference to this change. However, there are a number of changes to Attachment support as part of the ongoing Lightning feature rollout, and I'm guessing this is a side effect. There is a new Classic-only setting, "Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments", which I have confirmed is not enabled.
The ContentType of theses attachments is 'text/html; charset=UTF-16LE', although I have tested changing one to just 'text/html', which produces the same results.
Is there any documentation of this change? Has anyone else encountered it? Most importantly, is there any way to control which types of attachments cause a direct download? These documents are normally opened using the standard view link in the "Google Docs, Notes, & Attachments" related list on Oppty, so I'm hoping to avoid needing to build a custom "view" solution.
Edit 9 Feb 2016: I've learned that the behavior of file links is configurable in setup on a page titled "File Upload and Download Security". From there, you can choose, for various file types (by extension) the behavior of file links. There are 3 settings: Download forces a download, Execute in Browser opens the file in the Browser, and Hyrbid acts like Execute in Browser for Attachments, but acts like Download for Salesforce Files. I have confirmed that for the org in question, the setting for html files is "Hybrid" (Execute in Browser doesn't appear to be an option for html files). Although I would expect the determination of file type to be based on ContentType, the setup page uses list of file extensions, so I tried adding an explicit
.html to the
name field of one of the attachments, and have confirmed that it still doesn't work as expected.