52
rated 0 times
[
59]
[
7]
/ answers: 1 / hits: 7811
/ 11 Years ago, thu, december 26, 2013, 12:00:00
I am using javascript. I have a pdf file stored on server which i need to open in new tab using javascript. I have tried the below code
function openPDF() {
var urlToPdfFile = http://www.demosite.com/pdf/demo.pdf; //something like this
window.open(urlToPdfFile);
}
But I keep getting error like below
Unknown content type requested.
URL: '/pdf/demo.pdf'.
Requested extension: '.pdf'.
This because I see the content-type is html in the request.
how can I open PDF in new tab using javascript, by providing the content-type...?
Thanks
More From » pdf