Ok it was easily solved.
I modified app/controllers/files_controller.rb
Here is the diff:
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -1,5 +1,6 @@
class FilesController < ApplicationController
def download
+ if params[:type] == "note"
note = Note.find(params[:id])
uploader = note.attachment
@@ -12,6 +13,9 @@ class FilesController < ApplicationController
else
redirect_to uploader.url
end
+ elsif params[:type] == "extern"
+ send_file Rails.root.join('public', 'uploads', params[:type],
params[:filename] ).to_s, disposition: 'inline'
+ end
end
end
So basically stuff which is put in /public/uploads/extern/dir1/file1 can be
accessed through /files/extern/1/dir1/file1
Made it inline so files like html, pfd, etc are shown instead of the
browser trying to download it.
--
You received this message because you are subscribed to the Google Groups
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.