March 15, 2012

Download file problem due to version incompatibility of IE & Adobe Reader

Download file problem due to version incompatibility of IE & Adobe Reader

I have reviewed & updated the code. In fact when we throw the file content in page, it has two options
a) Will open PDF in the browser
b) Will start download immediately

Before correction in PHP script, you need to check the followings

If your problem is not resolved then have a look on this

Check your content type

Finally check your php code which you are using to download the files

Make these corrections in your php script


PHP Script:

$type = mime_content_type($filename);

header(“Pragma: public”);
header(“Expires: 0”);
header(“Pragma: no-cache”);
header(“Charset: null”);
header(“Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0”);
header(“Content-Type: application/force-download”);
header(“Content-Type: application/octet-stream”);
header(“Content-Type: application/download”);
header(‘Content-disposition: attachment; filename=’ . str_replace(‘ ‘,’-‘, file_parts($filename,’name’)));
header(“Content-Type: $type”);
header(“Content-Transfer-Encoding: binary”);
header(‘Content-Length: ‘ . filesize($filename));
@readfile($filename);
exit(0);

Last updated: March 19, 2014
Did it helped? 2 thoughts on “Download file problem due to version incompatibility of IE & Adobe Reader
  1. Pingback: Website Designing Website Development internet explorer cannot download 704 from site

  2. Pingback: php, mime_content_type, mime_content_type deprecated, finfo

Comments are closed.