• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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