The GridFS store uses MongoDB’s GridStore file storage system to store files
Retrieve the file from MongoDB’s GridFS GridStore
the filename of the file
a sanitized file
# File lib/carrierwave/storage/grid_fs.rb, line 101 def retrieve!(identifier) CarrierWave::Storage::GridFS::File.new(uploader, uploader.store_path(identifier)) end
Store the file in MongoDB’s GridFS GridStore
the file to store
a sanitized file
# File lib/carrierwave/storage/grid_fs.rb, line 84 def store!(file) stored = CarrierWave::Storage::GridFS::File.new(uploader, uploader.store_path) stored.write(file) stored end