kreeti / kt-paperclip

Easy file attachment management for ActiveRecord
Other
275 stars 95 forks source link

Support SFTP storage #110

Open alishersadikov opened 1 year ago

alishersadikov commented 1 year ago

First of all, thank you for this gem! Since the gem paperclip was deprecated, we have been using this gem for our S3 storage type attachments along with a different gem - paperclip-sftp for our SFTP storage type attachments. The gem paperclip-sftp uses the deprecated paperclip gem but it is also pretty minimal. We cannot use that gem any longer due to how old it is and the other code it breaks.

Is your feature request related to a problem? Please describe. It would be really nice if SFTP storage was a supported option and if we could use a DSL like this in our models:

  has_attached_file :csv, path: <path>, storage: :sftp,
    sftp_options: {
      host: <host>,
      user: <user>,
      password: <password>,
      port: <port>,
    }

Describe the solution you'd like We could potentially mimic what the other gem was doing: https://github.com/spectator/paperclip-sftp. Specifically we could add a new storage type that would look like this: https://github.com/spectator/paperclip-sftp/blob/master/lib/paperclip-sftp/storage/sftp.rb

Describe alternatives you've considered Currently we are intending to initialize our app with this Paperclip::Storage::Sftp module

Additional context I think this could be a useful feature for the community, but also a little surprised it was not requested before. Maybe SFTP attachments have other popular options nowadays?

ssinghi commented 1 year ago

We welcome any PR to add this feature, or you can declare a bounty to expedite it. Thanks!!