Socket
Socket
Sign inDemoInstall

multer-gcloud

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    multer-gcloud

A storage module for connect with multer.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

multer-gcloud

A storage module for connect gcloud with multer

Install

    $ npm install --save multer-gcloud

Config

var multer_gcloud = require('multer-gcloud');

var gcloud = require('@google-cloud/storage')({
  projectId: '<projectId>',
  keyFilename: '<google-cloud-service.json>'
});

var bucket = gcloud.bucket('<storageBucket>');

const storage = multer_gcloud({
  storage_bucket: '<storageBucket>',
  bucket: bucket,
  metadata: function (req, file, cb) {
    cb(null, file.mimetype);
  },
  destination: function (req, file, cb) {
    cb(null, 'uploads');
  },
  filename: function (req, file, cb) {
    cb(null, + Date.now() + '.' + ext(file.originalname));
  }
});

const upload = multer({ storage: storage }).single('picture');

Keywords

FAQs

Last updated on 31 Jul 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc