HTTP header for sending PDF, problem in Firefox

On windows, when I save the pdf with the Firefox plugin plugin, this issue occurs. Saved file:http://www.example.com/opendocument.php_doc=._docs_doc01

My headers:

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

      

Original challenge:

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

      

I am not interested in the attachment title. I have to open the website and not load the outer window.

Any idea?

+2


a source to share


2 answers


Try this, notice the quote around the filename

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

      



There is no way to guarantee this, but it comes from our PDF generation classes.

+4


a source


Try not to comment on the title Content-Disposition: inline;

and use the correct capital letter for Content-Type

(i.e. capital T )



+1


a source







All Articles