diff options
-rw-r--r-- | lib/serve.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js index 1bf2196..004079b 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -107,11 +107,16 @@ Serve.prototype.go = function () { } busboy.on('file', function (fieldname, file, filename, encoding, mimetype) { var cb = filesCb() + var size = 0 pull( toPull(file), + pull.map(function (data) { + size += data.length + return data + }), self.app.addBlob(!!data.private, function (err, link) { if (err) return cb(err) - if (link.size === 0 && !filename) return cb() + if (size === 0 && !filename) return cb() link.name = filename link.type = mimetype addField(fieldname, link) |