Merge pull request #55 from leandropio/patch-1

Expose file size on success callback
This commit is contained in:
Raymond Feng 2015-04-21 12:59:25 -07:00
commit 1e4a5c9f2a
1 changed files with 1 additions and 0 deletions

View File

@ -135,6 +135,7 @@ exports.upload = function (provider, req, res, options, cb) {
if (maxFileSize) { if (maxFileSize) {
part.on('data', function (buffer) { part.on('data', function (buffer) {
fileSize += buffer.length; fileSize += buffer.length;
file.size = fileSize;
if (fileSize > maxFileSize) { if (fileSize > maxFileSize) {
// We are missing some way to tell the provider to cancel upload/multipart upload of the current file. // We are missing some way to tell the provider to cancel upload/multipart upload of the current file.
// - s3-upload-stream doesn't provide a way to do this in it's public interface // - s3-upload-stream doesn't provide a way to do this in it's public interface