Class: CarrierWave::Uploader::Base
- Inherits:
-
Object
- Object
- CarrierWave::Uploader::Base
- Includes:
- Cache, Callbacks, Configuration, DefaultUrl, Download, ExtensionWhitelist, Mountable, Processing, Proxy, Remove, Store, Url, Versions
- Defined in:
- lib/carrierwave/uploader.rb
Overview
An uploader is a class that allows you to easily handle the caching and storage of uploaded files. Please refer to the README for configuration options.
Once you have an uploader you can use it in isolation:
my_uploader = MyUploader.new
my_uploader.cache!(File.open(path_to_file))
my_uploader.retrieve_from_store!('monkey.png')
Alternatively, you can mount it on an ORM or other persistence layer, with CarrierWave::Mount#mount_uploader. There are extensions for activerecord and datamapper these are very simple (they are only a dozen lines of code), so adding your own should be trivial.
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Attributes included from Mountable
Method Summary
Methods included from DefaultUrl
Methods included from Versions
#recreate_versions!, #url, #version_name, #versions
Methods included from Callbacks
Methods included from Processing
Methods included from ExtensionWhitelist
Methods included from Remove
Methods included from Download
Methods included from Cache
#cache!, #cache_name, #cache_stored_file!, #cached?, #retrieve_from_cache!
Methods included from Store
#delete_cache_id, #filename, #retrieve_from_store!, #store!, #store_path
Methods included from Mountable
Methods included from Url
Methods included from Proxy
#blank?, #current_path, #identifier, #length, #read, #size
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
26 27 28 |
# File 'lib/carrierwave/uploader.rb', line 26 def file @file end |