David
David

Reputation: 21

HTTP header for sending PDF, problem in Firefox

In windows when i save a pdf with firefox adobe reader plugin ocurs this problem. The file saved is: http://www.example.com/opendocument.php_doc=._docs_doc01

My headers are:

header('Content-type: application/pdf');
//header('Content-Disposition: inline; filename=doc01.pdf');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($pdf));

Original call is:

http://www.example.com/opendocument.php?doc=./docs/doc01.pdf

I'm not interest on attachment header. I must open into the website, not download o external window.

Any idea?

Upvotes: 2

Views: 14998

Answers (2)

Neil Aitken
Neil Aitken

Reputation: 7854

Give this a try, note the quoting around the filename

Content-disposition: inline; filename="doc01.pdf"

Can't guarantee this, but it's taken from our PDF generation classes.

Upvotes: 4

Joel
Joel

Reputation: 3060

Try un-commenting the Content-Disposition: inline; header, and use the correct capitalisation for Content-Type (that is, capital T)

Upvotes: 1

Related Questions