summaryrefslogtreecommitdiff
path: root/app/controllers/files_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-11 21:31:19 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-11 21:31:19 +0200
commita699ebdbcc11051b9473a88788cf8efdde659975 (patch)
tree05528b1407ed5375809d2cb936b7ebbcf647721a /app/controllers/files_controller.rb
parentab0cfc00367a60cfe9cc488521bf55882d54769a (diff)
downloadgitlab-ce-a699ebdbcc11051b9473a88788cf8efdde659975.tar.gz
handle attahcment with send_file
Diffstat (limited to 'app/controllers/files_controller.rb')
-rw-r--r--app/controllers/files_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
new file mode 100644
index 00000000000..f13a543cfdd
--- /dev/null
+++ b/app/controllers/files_controller.rb
@@ -0,0 +1,8 @@
+class FilesController < ApplicationController
+ def download
+ uploader = Note.find(params[:id]).attachment
+ uploader.retrieve_from_store!(params[:filename])
+ send_file uploader.file.path, disposition: 'attachment'
+ end
+end
+