Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 760 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 760 Bytes

Paperclip sftp Storage

Allow Paperclip attachments to be stored on SFTP servers. Inspired from [paperclip-storage-ftp] (https://github.com/xing/paperclip-storage-ftp)

Usage

Somewhere in your code:

require "paperclip/storage/sftp"

In your model:

class User < ActiveRecord::Base
  has_attached_file :avatar,

    # Choose the SFTP storage backend
    :storage => :sftp,
    # The list of SFTP options
    :sftp_options => [
      {
        :host      => "sftp.example.com",
        :directory => "my_assets_repository", #optional
        :path      => ":attachment/:id/:style/:filename",
        :user      => "foo"
      }
end