summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-09-23 07:47:40 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-23 18:07:47 +0200
commit635b0717931df907ee8015a42ad0ed1fcdf967c4 (patch)
treed301376b6dfc5326a7c2190c99194475ff7bc016 /application/controllers
parent551c359d8e50608093ba0f7179bd311d89e90da2 (diff)
Implement rangeDownload() as driver and provide sendfile implementations for Nginx and Lighttpd
* The rangeDownload() function has been moved to libraries/Ddownload/drivers/Ddownload_php.php * The nginx and lighttpd drivers can be set via $config['download_driver'] Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/file.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index b02cdd8ce..6ac0bc28c 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -98,10 +98,12 @@ class File extends MY_Controller {
exit();
}
+ $this->load->driver("ddownload");
+
// user wants the plain file
if ($lexer == 'plain') {
handle_etag($etag);
- rangeDownload($file, $filedata["filename"], "text/plain");
+ $this->ddownload->serveFile($file, $filedata["filename"], "text/plain");
exit();
}
@@ -122,7 +124,7 @@ class File extends MY_Controller {
header("$header_name: allow 'none'; img-src *; media-src *; font-src *; style-src * 'unsafe-inline'; script-src 'none'; object-src *; frame-src 'none'; ");
}
handle_etag($etag);
- rangeDownload($file, $filedata["filename"], $filedata["mimetype"]);
+ $this->ddownload->serveFile($file, $filedata["filename"], $filedata["mimetype"]);
exit();
}