Skip to content
Snippets Groups Projects
Commit 4821aa6c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

skip protection to aws3

parent a699ebdb
No related branches found
No related tags found
No related merge requests found
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
Loading
Loading
Loading
Loading
@@ -21,6 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base
end
 
def secure_url
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
if self.class.storage == CarrierWave::Storage::File
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
else
url
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment