2.1.1 • Published 2 years ago

multer-aliyun-oss v2.1.1

Weekly downloads
79
License
ISC
Repository
github
Last release
2 years ago

Multer Storage for AliYun OSS

Dependencies @ali-oss

Install

npm install --save multer-aliyun-oss

Usage

const multer = require('multer');
const MAO = require('multer-aliyun-oss');

const upload = multer({
    storage: MAO({
        config: {
            region: '<region>',
            accessKeyId: '<accessKeyId>',
            accessKeySecret: '<accessKeySecret>',
            bucket: '<bucket>',
        },
        // to set path prefix for files, could be string or function
        destination: ''
    })
});

File information

Each file contains the following information:

KeyDescriptionNote
fieldnameField name specified in the form
originalnameName of the file on the user's computer
encodingEncoding type of the file
mimetypeMime type of the file
sizeSize of the file in bytes
destinationThe folder to which the file has been savedDiskStorage
filenameThe name of the file within the destinationDiskStorage
pathThe full path to the uploaded fileDiskStorage
bufferA Buffer of the entire fileMemoryStorage

Option

destination

String or Function

// same signature as multer native
destination (req, file, callback) {
    callback(null, 'images')
}

Contact

angusyoung@mrxcool.com

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago