I have a simple model with an attached image using paperclip, which has a couple of processed styles for it (thumbnail, full, feature). At this point
If it is acceptable, you could skip saving the originals, by setting the default style.
has_attached_file :image,
:styles => { :normal => "800x600>" },
:default_style => :normal
If not, and you want to keep the originals, if you are using apache, you could use a .htaccess file to restrict the access to the originals directory
<FilesMatch "^\.(jpe?g|gif|png)$">
Order allow,deny
Deny from all
</Files>
I would recommend using a custom interpolation that will place your original files outside the public directory. Something like this:
Paperclip.interpolates :maybe_public do |attachment, style|
style == :original ? "private" : "public"
end
has_attached_file :image, :path => ":rails_root/:maybe_public/:attachment..."
This will save your :original files in a non-publicly accessible directory for protection, but still allow Paperclip access. And it will keep your thumbnails in the public directory for standard access.