Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
+