From f9d293e1fa859c2ef21d67547aeb7fe14c1d66ee Mon Sep 17 00:00:00 2001 From: Loic VELUT Date: Fri, 27 May 2016 09:24:36 +0200 Subject: [PATCH] Add provider upload response in final response --- lib/storage-handler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/storage-handler.js b/lib/storage-handler.js index 19275a6..eeba15c 100644 --- a/lib/storage-handler.js +++ b/lib/storage-handler.js @@ -132,8 +132,11 @@ exports.upload = function(provider, req, res, options, cb) { self.emit('error', err); }); - var endFunc = function() { + var endFunc = function(providerFile) { self._flushing--; + + file.providerResponse = providerFile; + var values = files[part.name]; if (values === undefined) { values = [file]; @@ -146,7 +149,7 @@ exports.upload = function(provider, req, res, options, cb) { }; writer.on('success', function(file) { - endFunc(); + endFunc(file); }); var fileSize = 0;