Skip to content

A simple storage engine which stores the files directly on cloudinary

License

Notifications You must be signed in to change notification settings

guptakvgaurav/multer-cloudinary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

multer-cloudinary

A simple storage engine which stores the files directly on cloudinary

var multerCloudinary = require('multer-cloudinary');
var Cloudinary = require('cloudinary');
Cloudinary.config({
  {
    cloud_name: '-----',
    api_key: '------',
    api_secret: '-----',
  }
});
var cloudinaryStorage = multerCloudinary({cloudinary: Cloudinary});

var cloudinaryUpload = multer({storage: cloudinaryStorage});
// It will upload a file which is received in form-data from the client. Key for the file is 'photo1'. 
router.put('/me', cloudinaryUpload.fields([{name: 'cover', maxCount:1}]));
// If you want to upload more than one file from form data, then add the 
router.put('/me', cloudinaryUpload.fields([{name: 'photo1', maxCount:1},{name: 'photo2', maxCount:1}]));

About

A simple storage engine which stores the files directly on cloudinary

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published