Download headers for Safari

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Thorstens

    Download headers for Safari

    Hi,

    I'm working on an old known problem: A JPG file has to be downloaded (not
    shown) in the browser. This is my current code:

    header('Content-Type: application/octet-stream');
    header('Content-Length:
    '.filesize($_RE QUEST["filepath"].$_REQUEST["file"]));
    if (strstr($_SERVE R['HTTP_USER_AGEN T'], "MSIE")) {
    header('Content-Disposition: attachment;
    filename="'.$_R EQUEST["file"].'"');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    } else {
    header('Content-Disposition: attachment;
    filename="'.$_R EQUEST["file"].'"');
    header('Pragma: no-cache');
    }
    readfile($_REQU EST["filepath"].$_REQUEST["file"]);


    This works fin with IE und Netsc. , Mozilla Linux etc. But not on mac's
    safari.
    What is the problem, what must i do to force the safari's download.

    Regards,
    Frank


Working...