New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

keystone-storage-adapter-dropbox

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keystone-storage-adapter-dropbox

Dropbox storage adapter for keystonejs

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Dropbox storage adapter for keystonejs

Usage

Configure the storage adapter:

var storage = new keystone.Storage({
  adapter: require('keystone-storage-adapter-dropbox'),
  dropbox: {
      accessToken: process.env.DROPBOX_ACCESS_TOKEN,// your dropbox-app access token
      path: process.env.DROPBOX_PATH + '/uploads',// any path
  },
  path: process.env.DROPBOX_PATH + '/uploads',
  schema: {
    filename: true,
    path_display: true,
    path: true,
    id: true,
    url: true,
    originalname: true,   // the original (uploaded) name of the file; useful when filename generated
  },
});

Then use it as the storage provider for a File field:

File.add({
  name: { type: String },
  file: { type: Types.File, storage: storage },
});

Options:

The adapter requires an additional s3 field added to the storage options. It accepts the following values:

  • accessToken: (required) Dropbox app access token.

  • path: Storage path inside the app folder.

Tips

  • Delete file from dropbox if delete from db

        Documents.schema.post('remove', async function (doc) {
            return storage.removeFile(doc.file, () => {
        
            });
        });
    

License

Licensed under the standard MIT license. See LICENSE.

Keywords

FAQs

Package last updated on 19 Oct 2017

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc