Socket
Book a DemoInstallSign in
Socket

paperclipdropbox

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paperclipdropbox

2.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

= PaperclipDropboxStorage

Dropbox storage support for kt-paperclip file attachment plugin.

== Install

You can let bundler install Paperclip Dropbox Plugin by adding this line to your application's Gemfile:

gem 'paperclipdropbox'

And then execute:

bundle install

Or install it yourself as:

gem install paperclipdropbox

Then run the authotization task

rails paperclipdropbox:authorize

you'll then be given a url to login to dropbox to authorize this plugin access to your dropbox account.

== Usage

In your model:

class User < ActiveRecord::Base has_attached_file :avatar, styles: { medium: "300x300>", thumb: "100x100>" }, default_url: "/missing.png", storage: :Dropbox, path: ":class/:attachment/:style/:id_:filename" end

Add a migration script to add the dropbox_share_urls column

class AddDropboxShareIdsToUsers < ActiveRecord::Migration[7.0] def change add_column :users, :dropbox_share_urls, :string, default: "{}", null: false end end

== Optional

=== App Folder This is the first folder in your dropbox before the paths take effect

==== Usage app_folder: "Rails_Super_App", # defaults to "Paperclip_Dropbox" if not passed

=== Remove Url Redirects This is a experimental.. the urls provided by Dropbox are redirecting urls. this adds additional time to the image load to the user. this option will follow the redirect url and get the direct url to pass to the browser.

However this url will expire in 3-4 hours. The direct url is cached in Rails with a lifetime of 3 hours. at wich point it will retreive a new direct url to use.

AGAIN EXPERIMENTAL so this can cause longer page loads when it needs to go and get the new direct url.

==== Usage remove_url_redirects: true, # default is false

FAQs

Package last updated on 08 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.