diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-11 21:31:19 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-11 21:31:19 +0200 |
commit | a699ebdbcc11051b9473a88788cf8efdde659975 (patch) | |
tree | 05528b1407ed5375809d2cb936b7ebbcf647721a /app/controllers/files_controller.rb | |
parent | ab0cfc00367a60cfe9cc488521bf55882d54769a (diff) | |
download | gitlab-ce-a699ebdbcc11051b9473a88788cf8efdde659975.tar.gz |
handle attahcment with send_file
Diffstat (limited to 'app/controllers/files_controller.rb')
-rw-r--r-- | app/controllers/files_controller.rb | 8 |
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 + |