Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/2do2go/upload-hash-name-middleware
- Owner: 2do2go
- Created: 2013-03-31T20:05:31.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-03-31T21:43:03.000Z (almost 12 years ago)
- Last Synced: 2024-11-10T19:42:09.764Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.