Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Rename express file uploads to names based on hash of file content
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
.npmignore
README.md
package.json

README.md

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)

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.

Something went wrong with that request. Please try again.