Gathering detailed insights and metrics for multer-ali-oss
Gathering detailed insights and metrics for multer-ali-oss
Gathering detailed insights and metrics for multer-ali-oss
Gathering detailed insights and metrics for multer-ali-oss
npm install multer-ali-oss
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
8 Stars
7 Commits
3 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Feb 02, 2023
Latest Version
0.0.3
Package Id
multer-ali-oss@0.0.3
Size
1.81 kB
NPM Version
3.8.9
Node Version
6.2.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Streaming multer storage engine for Aliyun OSS.
1npm install --save multer-ali-oss
1var multer = require('multer'); 2var aliOssStorage = require('multer-ali-oss'); 3 4var upload = multer( { 5 storage: aliOssStorage({ 6 config: { 7 region: '<region>', 8 accessKeyId: '<accessKeyId>', 9 accessKeySecret: '<accessKeySecret>', 10 bucket: '<bucket>', 11 }, 12 filename: function (req, file, cb) { 13 cb(null, file.fieldname + '-' + Date.now()) 14 } 15 }) 16}).single('upload'); 17 18router.post('/', function(req, res, next) { 19 upload(req, res, function (err) { 20 if (err) { 21 // handle error 22 } 23 24 var result = { 25 "uploaded": 1, 26 'name': req.file.name, 27 "url": req.file.url 28 }; 29 30 res.render('result', {}); 31 }); 32});
Each file contains the following information:
Key | Description | Note |
---|---|---|
fieldname | Field name specified in the form | |
originalname | Name of the file on the user's computer | |
encoding | Encoding type of the file | |
mimetype | Mime type of the file | |
size | Size of the file in bytes | |
name | Name of the file | AliOssStorage |
url | Url of the file on OSS | AliOssStorage |
As the ali-oss
, one of the dependencies, using the ES6 features. The app depends on this package should start with --harmony
.
You need to specify the region
, accessKeyId
, accessKeySecret
, bucket
.
1var aliOssStorage = require('multer-ali-oss'); 2var storage = aliOssStorage({ 3 config: { 4 region: '<region>', 5 accessKeyId: '<accessKeyId>', 6 accessKeySecret: '<accessKeySecret>', 7 bucket: '<bucket>', 8 }, 9 filename: function (req, file, cb) { 10 cb(null, file.fieldname + '-' + Date.now()) 11 } 12}) 13 14var upload = multer({ storage: storage })
There is one option available, filename
. It is a function that determine where the file should be stored.
filename
is used to determine what the file should be named. If no filename is given, each file will be given a random name that doesn't include any file extension.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More