1

On my employer web server, we have 200+ PHP applications with this kind of code to allow download of a file :

header('Content-Disposition: attachment; filename="file.pdf"');
header('Expires: 0');
header('Pragma: no-cache');

It run fine on the old server (Debian Lenny, PHP 5.2, Apache 2.2.9), but fail on IE8 with the new one (Debian Squeeze, PHP 5.2, Apache 2.2.16). Others browsers are fines. We only access file via HTTPS, never HTTP. We do not find any difference between the conf file, but replacing no-cache by private correct the problem with IE. Where can we look to understand where the difference is?

2
  • If you want to look to see what the differences is you look at the HTTP specifications. w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32 I really don't understand what the pragma should have to do with anything in the context of this question though. You try using the hacky method of forcing a non-standard mime-type. Header("Content-type: application/force-download");
    – Zoredache
    Dec 5, 2012 at 18:35
  • The force-download does not change anything. It was is my toolbox, but not the right tool. I do not understand why there is a difference, still working on it. Dec 6, 2012 at 14:46

0

You must log in to answer this question.

Browse other questions tagged .