I'm using EXTJS, i have a link, which is used to open a PDF file. The problem is that the pdf is not opened in the navigator, but it's downloaded ! The code i'm using is the following (which i found in stack ! )
var win = window.open(url, '_blank');
win.focus();
what i'm messing ?
Browser decides whether to open the file or show it inline (in the new tab) depending on received HTTP headers.
To download, server sends this header:
Content-Disposition: Attachment; filename="somefile.pdf"
To show inline, server sends this header:
Content-Disposition: Inline