Answer the question
In order to leave comments, you need to log in
How to disable access to original images in Carrierwave?
Hello.
It is necessary to save the original images without a watermark. How can you restrict access from outside to the original images?
def filename
"#{model.slug}.#{file.extension}" if original_filename.present?
end
Answer the question
In order to leave comments, you need to log in
You need to prohibit using the settings of the web server that serves the files.
For example, rename all originals to original.* and close access to them
location ~* /original\.(gif|jpg|jpeg)$ {
deny all
}
Create a folder inaccessible via http and upload files there. Example for paperclip:
Paperclip.interpolates :maybe_public do |attachment, style|
style == :original ? "private" : "public"
end
has_attached_file :image,
:styles => ....,
:path => ":rails_root/files/:maybe_public/:id_partition/:id/:style/:basename.:extension"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question