• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Server content-type setting for PDF

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-
 
Back
Top