Sha256: 9cec14e046cdcf70e29b03bcd967096f517cee36984faabbdf58c965f1f8162e

Contents?: true

Size: 1.52 KB

Versions: 1

Compression:

Stored size: 1.52 KB

Contents

# FTP Storage for Paperclip

Allow [Paperclip](https://github.com/thoughtbot/paperclip) attachments
to be stored on FTP servers.

## Installation

Add this line to your application's Gemfile:

    gem 'paperclip-storage-ftp'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install paperclip-storage-ftp

## Usage

Somewhere in your code:

    require "paperclip/storage/ftp"

In your model:

    class User < ActiveRecord::Base
      has_attached_file :avatar,

        # Choose the FTP storage backend
        :storage => :ftp,

        # Set where to store the file on the FTP server(s).
        # This supports Paperclip::Interpolations.
        :path => "/path_on_ftp_server/:attachment/:id/:style/:filename"

        # The full URL of where the attachment is publicly accessible.
        # This supports Paperclip::Interpolations.
        :url => "/url_prefix/:attachment/:id/:style/:filename"

        # The list of FTP servers to use
        :ftp_servers => [
          {
            :host     => "ftp1.example.com",
            :user     => "foo",
            :password => "bar"
          },
          # Add more servers if needed
          {
            :host     => "ftp2.example.com",
            :user     => "foo",
            :password => "bar"
          }
        ]
    end

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paperclip-storage-ftp-1.0.0.rc1 README.md