Submitted by Interact on Thu, 02/06/2014 - 14:53
I have set header in the code to be Content-Type: application/pdf but server throws as text/html
Any clue?
Thanks
Status:
Active
I have set header in the code to be Content-Type: application/pdf but server throws as text/html
Any clue?
Thanks
Comments
Submitted by JamieCameron on Thu, 02/06/2014 - 15:37 Comment #1
Is this PDF being output by a PHP script?
Submitted by Interact on Thu, 02/06/2014 - 16:21 Comment #2
Yes - PHP script with header forced by that script: http://devot-ee.com/add-ons/http-header Even when I have try to use header('Content-type: application/pdf') is not rendering as PDF
Thanks
Submitted by JamieCameron on Thu, 02/06/2014 - 16:40 Comment #3
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 .
Submitted by Interact on Thu, 02/06/2014 - 16:46 Comment #4
I have tested it with simple PHP code using FPDF library and it works. No clue what is forcing double headers.
Submitted by JamieCameron on Thu, 02/06/2014 - 20:08 Comment #5
Unfortunately I'm not a PHP expert, so I can't help much here.