multer-custom-storage
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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);
});

Readme

Keywords

none

Package Sidebar

Install

npm i multer-custom-storage

Weekly Downloads

4

Version

1.1.1

License

ISC

Unpacked Size

29 kB

Total Files

6

Last publish

Collaborators

  • fverse