B
bhemesath
Guest
I migrated a PHP-based site from Plesk 6.x (PHP 4.3.3) to a brand new plesk 7.5 box (PHP 4.3.9).
One part of the site offers files to be downloaded indirectly. By indirectly, I mean the URL doesn't give away the location of the file. I.e., http://site.com/file.php?id=203
This worked fine on the old box for all file types (pdf, doc, jpg, etc).
The new server does not like the PDF file type (or probably my code). doc and jpg file types are OK.
When an end-user clicks the link on the public site, it opens the new window, the Adobe splash screen appears as if the PDF is opening, and then an alert box appears: "The file is damaged and could not be repaired."
In my php code, I start the header with this:
header("Content-type: application/pdf");
(and optional) header('Content-Type: application/octet-stream');
Now, if I change my php code to this:
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=test.pdf");
It will allow me to Save the PDF and open it.
Any thoughts? Thanks in advance-
One part of the site offers files to be downloaded indirectly. By indirectly, I mean the URL doesn't give away the location of the file. I.e., http://site.com/file.php?id=203
This worked fine on the old box for all file types (pdf, doc, jpg, etc).
The new server does not like the PDF file type (or probably my code). doc and jpg file types are OK.
When an end-user clicks the link on the public site, it opens the new window, the Adobe splash screen appears as if the PDF is opening, and then an alert box appears: "The file is damaged and could not be repaired."
In my php code, I start the header with this:
header("Content-type: application/pdf");
(and optional) header('Content-Type: application/octet-stream');
Now, if I change my php code to this:
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=test.pdf");
It will allow me to Save the PDF and open it.
Any thoughts? Thanks in advance-