File storage stores file to the Filesystem (surprising, no?). There’s really not much to it, it uses the store_dir defined on the uploader as the storage location. That’s pretty much it.
Retrieve the file from its store path
the filename of the file
a sanitized file
# File lib/carrierwave/storage/file.rb, line 40 def retrieve!(identifier) path = ::File.expand_path(uploader.store_path(identifier), uploader.root) CarrierWave::SanitizedFile.new(path) end
Move the file to the uploader’s store path.
the file to store
a sanitized file
# File lib/carrierwave/storage/file.rb, line 23 def store!(file) path = ::File.expand_path(uploader.store_path, uploader.root) file.move_to(path, uploader.permissions) file end