How to: Keep uploaded files (for a specific uploader)

roccoblues edited this page Jan 20, 2012 · 1 revision
Clone this wiki locally

To keep all uploaded files use an initializer like this:

CarrierWave.configure do |config|
  config.remove_previously_stored_files_after_update = false
end

If you want to configure that on a per-uploaded basis:

class AvatarUploader < CarrierWave::Uploader::Base
  configure do |config|
    config.remove_previously_stored_files_after_update = false
  end

  ...
end