diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-06-11 23:52:02 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-06-11 23:52:02 +0200 |
commit | bc8cd4f81d57763d7b3cf73138c4befee3f1139c (patch) | |
tree | 0bce51fe92fbf16e09a4d80da127c133d0e29b4d /application/models | |
parent | e24a004cbe26764a180bea14c556e94f079f368f (diff) |
support simple request ranges for direct downloads
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models')
-rw-r--r-- | application/models/file_mod.php | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/application/models/file_mod.php b/application/models/file_mod.php index 54fe3d550..f13fd40b8 100644 --- a/application/models/file_mod.php +++ b/application/models/file_mod.php @@ -254,17 +254,9 @@ class File_mod extends CI_Model { || filesize($file) > $this->config->item('upload_max_text_size') ) { if ($mode == 'plain') { - header("Content-Type: text/plain\n"); - } else { - header("Content-Type: ".$type."\n"); - } - header("Content-disposition: inline; filename=\"".$filedata['filename']."\"\n"); - header("Content-Length: ".filesize($file)."\n"); - $fp = fopen($file,"r"); - while (!feof($fp)) { - echo fread($fp,4096); + $type = "text/plain"; } - fclose($fp); + rangeDownload($file, $filedata["filename"], $type); exit(); } |