Apache displays generated PDF as text/html

I have set header in the code to be Content-Type: application/pdf but server throws as text/html

Any clue?

Thanks

Status: 
Active

Comments

Is this PDF being output by a PHP script?

I don't think this is a Virtuamin or Apache issue - neither would be forcing the HTTP header. More likely the header is being set twice in the script, perhaps once to the default of text/html and then again by your code to application/pdf .

I have tested it with simple PHP code using FPDF library and it works. No clue what is forcing double headers.

Unfortunately I'm not a PHP expert, so I can't help much here.