Add configuration option to serve local PDF uploads inline

Our incoming communication (via email) is heavily dependent on PDFs.

Current behaviour of discourse is to serve this files as download only.

What risks do you see adding a configuration option, which set content-disposition: inline for PDFs or maybe also other file formats?

5 Likes

This makes a lot more sense to me than the current default behaviour.

When I encounter a PDF in a post, I generally want to read it - not download it. Almost all PDF viewers allow the reader to download the file (if they wish) quite easily.

The current behaviour causes a particular problem in Android, where if a PDF has already been downloaded it simply asks if you wish to download it again. If you say ‘no’, you don’t get to read it. If you say yes, you add another copy to your downloads folder. Both suck a bit.

Of note, the Inline PDF Previews Theme Component would almost do the desired behaviour if

  1. this bug is fixed
    and
  2. it applied opening in new tabs to mobile as well
2 Likes

I think this has been fixed / sorted now and this feature request can be closed.

It is so much better!!!

1 Like