views:

104

answers:

2

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?

A: 

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

Joel L
no, this not works
David
made another suggestion, above
Joel L
HTTP header field names are case-insensitive.
Gumbo
A: 

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.

Neil Aitken