# multer-storage-qiniu

> Qiniu Multer Storage Engine

Latest version **0.1.0** (published 2016-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install multer-storage-qiniu
pnpm add multer-storage-qiniu
yarn add multer-storage-qiniu
bun add multer-storage-qiniu
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-12-14 |
| First published | 2016-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ming & originalexe |
| Maintainers | sunoj |
| Keywords | multer, qiniu, qn, node.js |

## Links

- npm: https://www.npmjs.com/package/multer-storage-qiniu
- Repository: https://github.com/sunoj/Multer-Storage-Qiniu
- Homepage: https://github.com/sunoj/Multer-Storage-Qiniu#readme
- Issues: https://github.com/sunoj/Multer-Storage-Qiniu/issues
- npm.io page: https://npm.io/package/multer-storage-qiniu

## Dependencies (4)

- [path](https://npm.io/package/path.md) ^0.12.7
- [qiniu](https://npm.io/package/qiniu.md) ^6.1.13
- [crypto](https://npm.io/package/crypto.md) 0.0.3
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.9

## Recent versions

- 0.1.0 (latest) — 2016-12-14

## README

# Multer-Storage-qiniu
Qiniu Multer Storage Engin

Multer Storage Engine that uses Qiniu as a storage system. Uses an offical Qiniu SDK.

## Installation
	
	npm install multer-storage-qiniu
	
## Dependencies
* qiniu   - for communication with the qiniu
* crypto  - for generating a pseudo random filename if one is not provided
* path    - for precise paths handling

## Usage
Multer-Storage-Qiniu follows the naming convention set by an existing DiskStorage storage engine that comes with multer.
```javascript
var multer = require( 'multer' );
var qiniu = require( 'multer-storage-qiniu' );
var storage = qiniu({
	destination : function( req, file, cb ) {
		
		cb( null, 'multer-uploads/my-files' );
		
	},
	filename    : function( req, file, cb ) {
		
		cb( null, file.fieldname + '-' + Date.now() );
		
	},
	config      :  {
		ACCESS_KEY: <YOUR_ACCESS_KEY>,
		SECRET_KEY: <YOUR_SECRET_KEY>,
		bucket: <BUCKET_NAME>,
	}
});
var uploadMiddleware = multer({ storage: storage });

app.post( '/upload', uploadMiddleware.single( 'attachment' ), function( req, res, next ) {

	res.send( 'File was uploaded successfully!' );

});
```


## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/multer-storage-qiniu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
