0.1.2 • Published 1 year ago

@flystorage/multer-storage v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Flystorage for multer

This package contains the Flystorage bindings for multer.

This allows multer to upload to any of the supported Flystorage filesystems.

Installation

Install all the required packages

npm install --save @flystorage/file-storage @flystorage/multer-storage

Usage

import {FileStorage} from '@flystorage/file-storage';
import {FlystorageMulterStorageEngine} from '@flystorage/multer-storage';
import multer from 'multer';

const adapter = createYourAdapter();
const fileStorage = new FileStorage(adapter);

const storage = new FlystorageMulterStorageEngine(
    uploadStorage,
    async (action, _req: express.Request, file: Express.Multer.File) => {
        if (action === 'handle') {
            return file.originalname;
        } else {
            return file.destination;
        }
    }
);

const uploader = multer({storage});
0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.5

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago