htmlpdf

Opening files in browser instead of downloading


I have a href link to a pdf file that when clicked on it downloads. I want this to just open in a new page instead of downloading.

<a href="../file/1012">clicking here</a>

I've had a look at a website that does this with iframe, but I would prefer not to use that.


Solution

  • add target="_blank" to get a new window. adding .pdf may help. If you have control over the host web server adjusting the headers for the files in question will also help it open inline. I can tell you what headers to set if you are able too