If (strpos ($ _ server ['HTTP _ user_agent '], "MSIE ")! = False) {header ('content-type :'. $ MIME); // <--- 1) header ('content-Disposition: attachment; filename = "'. $ filename. '"'); header ('expires: 0'); header ('cache-control: Must-revalidate, post-check = 0, pre-check = 0 '); header ("content-transfer-encoding: Binary"); header ('pragma: public'); header ("Content-Length :". strlen ($ data);} else {header ('content-type :'. $ MIME); // <--- 2) header ('content-Disposition: attachment; filename = "'. $ filename. '"'); header (" content-transfer-encoding: Binary "); header ('expires: 0'); header ('pragma: No-cache '); header ("Content-Length :". strlen ($ data ));}
Code before modification:
if (strpos($_SERVER[‘HTTP_USER_AGENT‘], "MSIE") !== FALSE) { header(‘Content-Type: "‘.$mime.‘"‘); header(‘Content-Disposition: attachment; filename="‘.$filename.‘"‘); header(‘Expires: 0‘); header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0‘); header("Content-Transfer-Encoding: binary"); header(‘Pragma: public‘); header("Content-Length: ".strlen($data)); } else { header(‘Content-Type: "‘.$mime.‘"‘); header(‘Content-Disposition: attachment; filename="‘.$filename.‘"‘); header("Content-Transfer-Encoding: binary"); header(‘Expires: 0‘); header(‘Pragma: no-cache‘); header("Content-Length: ".strlen($data)); }
A small bug in downloading helper functions in the codeigniter framework