summaryrefslogtreecommitdiff
path: root/app/controllers/files_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/files_controller.rb')
-rw-r--r--app/controllers/files_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 9671245d3f4..15523cbc2e7 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -5,8 +5,11 @@ class FilesController < ApplicationController
if uploader.file_storage?
if can?(current_user, :read_project, note.project)
+ # Replace old notes location in /public with the new one in / and send the file
+ path = uploader.file.path.gsub("#{Rails.root}/public", Rails.root.to_s)
+
disposition = uploader.image? ? 'inline' : 'attachment'
- send_file uploader.file.path, disposition: disposition
+ send_file path, disposition: disposition
else
not_found!
end