Skip to content

Use cloud storage solutions like IBM COS, Aws S3 and Azure Blob Storage as the storage engine for Multer

Notifications You must be signed in to change notification settings

fverse/multer-custom-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multer Custom Storage

This package extends Multer, a Node.js middleware for handling multipart/form-data, to use various cloud storage solutions as custom storage engines. It currently supports IBM Cloud Object Storage (COS), with planned support for AWS S3, Azure Blob Storage, and more.

Installation

To install the package, run the following command:

npm install multer-custom-storage

Usage

const { CosStorage } = require("multer-custom-storage");

const upload = multer({
  storage: CosStorage({
    // The name of the IBM Cloud Object Storage bucket where files will be stored.
    bucket: "",
    // The endpoint URL for the IBM Cloud Object Storage.
    endpoint: "",
    // The API key for accessing IBM Cloud Object Storage.
    apiKeyId: "",
    // The service instance ID of the IBM Cloud Object Storage.
    serviceInstanceId: "",
  }),
}).array("files");

app.post("/upload", upload, function (req, res) {
  res.json(req.files);
});

About

Use cloud storage solutions like IBM COS, Aws S3 and Azure Blob Storage as the storage engine for Multer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published