Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/2do2go/upload-hash-name-middleware

Rename express file uploads to names based on hash of file content
https://github.com/2do2go/upload-hash-name-middleware

Last synced: about 1 month ago
JSON representation

Rename express file uploads to names based on hash of file content

Awesome Lists containing this project

README

        

# upload to hash rename expressjs middleware

This middleware renames file uploads to names based on hash of file content

## Usage

set `hash` option for bodyParser, include upload-hash-name-middleware (after
bodyParser)

```js
var app = express.createServer();
app.use(express.bodyParser({hash: 'md5'}));
app.use(require('upload-hash-name-middleware'));
```

that's all now all uploads will be stored by its hashes as name.