summaryrefslogtreecommitdiffstats
path: root/system/helpers/download_helper.php
diff options
context:
space:
mode:
authorTimothy Warren <tim@timshomepage.net>2012-01-25 14:37:49 +0100
committerTimothy Warren <tim@timshomepage.net>2012-01-25 14:37:49 +0100
commita44a1ca6be4075e8a76e9dff9b31178687f01cee (patch)
treec70fbf11e9add3bf4b6ff211cd53b18ae903e67f /system/helpers/download_helper.php
parent8f9e93dd37ae0090c9b4117138cd3135bfe3f67a (diff)
parentd5e07b072cf05a24ad24e0b5d4b55eaa50d1c655 (diff)
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
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);