Module | Paperclip::Storage::Filesystem
In: | vendor/plugins/paperclip/lib/paperclip/storage.rb

The default place to store attachments is in the filesystem. Files on the local filesystem can be very easily served by Apache without requiring a hit to your app. They also can be processed more easily after they‘ve been saved, as they‘re just normal files. There is one Filesystem-specific option for has_attached_file.

- `path`: The location of the repository of attachments on disk. This can (and, in almost all cases, should) be coordinated with the value of the `url` option to allow files to be saved into a place where Apache can serve them without hitting your app. Defaults to ":rails_root/public/:attachment/:id/:style/:basename.:extension" By default this places the files in the app‘s public directory which can be served directly. If you are using capistrano for deployment, a good idea would be to make a symlink to the capistrano-created system directory from inside your app‘s public directory. See Paperclip::Attachment#interpolate for more information on variable interpolaton.

        :path => "/var/app/attachments/:class/:id/:style/:basename.:extension"

### Methods

exists? extended to_file to_io

### Public Class methods

extended(base)

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/storage.rb, line 20
    20:       def self.extended base
    21:       end

### Public Instance methods

exists?(style = default_style)

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/storage.rb, line 23
    23:       def exists?(style = default_style)
    24:         if original_filename
    25:           File.exist?(path(style))
    26:         else
    27:           false
    28:         end
    29:       end

to_file(style = default_style)

Returns representation of the data of the file assigned to the given style, in the format most representative of the current storage.

[Source]

        # File vendor/plugins/paperclip/lib/paperclip/storage.rb, line 33
    33:       def to_file style = default_style
    34:         @queued_for_write[style] || (File.new(path(style), 'rb') if exists?(style))
    35:       end

to_io(style = default_style)

Alias for to_file

[Validate]