1.1.1 • Published 4 months ago

multer-custom-storage v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

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

4 months ago

1.1.0

4 months ago

1.0.9

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago