pdf generation - IE ignores octet-stream - how to force download? -
i'm using wkhtmltopdf generate pdf files. program accepts 1 of 2 contenttype values, 'application/pdf' , 'application/octet-stream'. want pdf files generated saved user's machine, set 'application/octet-stream'. chrome prompted download, expected. did firefox. of course internet explorer ignored setting , opened pdf file in browser window instead. i'm using internet explorer 8 , 9 testing this. don't have access server, , don't want change how pdf files handled in case. want application prompt user download file, , need know how force ie instead of ignoring contenttype value.
i used fiddler2 check out how contenttype being reported in ie , chrome, , both show 'application/octet-stream', i'm not sure why ie insisting on rendering pdf in browser. advice?
php code:
header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("pragma: public"); header("content-type: application/octet-stream"); header("content-disposition: attachment; filename=\"filename\"");
this should work.
Comments
Post a Comment