Skip to content

Commit

Permalink
Merge pull request #57 from tumulr/master
Browse files Browse the repository at this point in the history
Added md5 checksum for each file upload
  • Loading branch information
richardgirges authored Jan 19, 2018
2 parents c3c41ec + ded00eb commit dc923e2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const Busboy = require('busboy');
const fs = require('fs-extra');
const streamifier = require('streamifier');
const md5 = require('md5');

const ACCEPTABLE_MIME = /^(?:multipart\/.+)$/i;
const UNACCEPTABLE_METHODS = [
Expand Down Expand Up @@ -134,6 +135,7 @@ function processMultipart(options, req, res, next) {
data: buf,
encoding: encoding,
mimetype: mime,
md5: md5(buf),
mv: function(path, callback) {
// Callback is passed in, use the callback API
if (callback) {
Expand Down
33 changes: 33 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"busboy": "^0.2.14",
"fs-extra": "^4.0.1",
"md5": "^2.2.1",
"streamifier": "^0.1.1"
},
"engines": {
Expand Down

0 comments on commit dc923e2

Please sign in to comment.