summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorEric Roberts <eric@cryode.com>2012-01-27 01:20:31 +0100
committerEric Roberts <eric@cryode.com>2012-01-27 01:20:31 +0100
commit4d4dcae1ff484dad539bc5649cf66e39c3944960 (patch)
tree51a08b1a647157064e52ced377cb537616d8b2d0 /system/helpers
parent41cc0908918f48d948fe1e1fc9c74fdec58b7a60 (diff)
parented6485b7c72cf1d1c0ce1a329677a47f8840098a (diff)
Merge branch 'refs/heads/develop' into feature/form_error_msgs
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/download_helper.php26
1 files changed, 10 insertions, 16 deletions
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 4a1a79cc3..aea948d81 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -88,26 +88,20 @@ if ( ! function_exists('force_download'))
{
$mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension];
}
-
+
// Generate the server headers
- if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE)
+ header('Content-Type: "'.$mime.'"');
+ header('Content-Disposition: attachment; filename="'.$filename.'"');
+ header('Expires: 0');
+ header("Content-Transfer-Encoding: binary");
+ header("Content-Length: ".strlen($data));
+ header('Pragma: no-cache');
+
+ // Internet Explorer-specific headers.
+ if (isset($_SERVER['HTTP_USER_AGENT']) && 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));
}
exit($data);