I have a CarrierWave uploader, I need to disable the deletion of cached files after saving them to the store. To then perform some kind of operation with this cached file and delete it manually.
My uploader:
class FileUploader < CarrierWave::Uploader::Base
def store_dir
"store"
end
def cache_dir
'tmp'
end
def size_range
0..100.megabytes
end
end
You can use the callbacks, before/after store.
Sharing a snippet here along with a link -
This callback is triggered after file is uploaded. Make sure you delete the cache manually after using the callback.Just play around to understand how it works.
Check this Carrierwave WIKI page for more details.