Hello,
I would like PDFs not to be downloaded automatically, but instead to be previewed or opened in a new tab.
Does anyone have a solution for this?
Hello,
I would like PDFs not to be downloaded automatically, but instead to be previewed or opened in a new tab.
Does anyone have a solution for this?
I think it can be influenced by the browser configuration. Zammad is not showing directly inline, because of security reasons, it will always be downloaded.
Also a duplicate of Improve article attachment preview for new file extensions Word, Excel and PDF
I think I understand the ask here, and I would agree it would be helpful: You canāt force the browser to use its built-in preview functionality, but you can encourage it by setting the Content-Disposition header to āinlineā when serving the request for the file. For example: āContent-Disposition: inline; filename=āsome_file.pdfāā, would cause Chrome-based and Firefox browsers to open the PDF in-browser, rather than downloading the file. I imagine images would work the same as well.
Iād suggest not to vote the denied duplicate and vote the favored one instead.
Apart from that, I believe that a software shouldnāt decide how a browser should open a file for the user. Thatās a browser configuration, no?
Iāve voted over there, thanks for pointing that out.
Hereās the MDN documentation regarding the Content-Disposition header: Content-Disposition header - HTTP | MDN
Iād argue that it doesnāt force the browser to do anything, merely suggests the siteās intent with the content. Obviously, like everything with browsers, they all handle it a touch differently
.