Add support for on-disk file streaming.

This commit is contained in:
Charles Pence
2013-06-18 21:49:38 -04:00
parent db0b536b5b
commit 5428161e0f
2 changed files with 13 additions and 3 deletions
+7 -3
View File
@@ -403,9 +403,13 @@ module Precious
@bar_side = wiki.bar_side
mustache :page
elsif file = wiki.file(fullpath)
content_type file.mime_type
file.raw_data
elsif file = wiki.file(fullpath, wiki.ref, true)
if file.on_disk?
send_file file.on_disk_path, :disposition => 'inline'
else
content_type file.mime_type
file.raw_data
end
else
page_path = [path, name].compact.join('/')
redirect to("/create/#{clean_url(encodeURIComponent(page_path))}")