summaryrefslogtreecommitdiffstats
path: root/system/helpers/download_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-27 20:21:50 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-27 20:21:50 +0100
commit0654403aaac9c642074529b319eba182d3dcdde0 (patch)
tree65eb1e39cfd3d979840a079a157d696070f1c0c1 /system/helpers/download_helper.php
parent85facfa42793cce480d2f49696c2d3e3096763f0 (diff)
parent0c4fb6a578d23e5a0fa5c8ce41a75d2b2b1310e7 (diff)
Merge upstream branch
Diffstat (limited to 'system/helpers/download_helper.php')
-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);