From 427f270a40c5c42605fe143dc24d4323a421cf81 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Thu, 27 Jun 2013 13:50:57 -0700 Subject: [PATCH] Support uploading multiple files --- example/upload.js | 4 ++-- lib/storage-handler.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/upload.js b/example/upload.js index f99ff59..dd92ed8 100644 --- a/example/upload.js +++ b/example/upload.js @@ -21,7 +21,7 @@ app.get('/', function (req, res, next) { "List all containers

" + "Upload to container c1:

" + "

" - + "File to upload:
" + + "File to upload:
" + "Notes about the file:
" + "
" + ""; @@ -70,4 +70,4 @@ app.get('/download/:container/:file', function (req, res, next) { }); }); -app.listen(app.get('port')); \ No newline at end of file +app.listen(app.get('port')); diff --git a/lib/storage-handler.js b/lib/storage-handler.js index deeeaf9..1a884c4 100644 --- a/lib/storage-handler.js +++ b/lib/storage-handler.js @@ -61,7 +61,7 @@ Uploader.prototype.processUpload = function (req, res, cb) { part.on('end', function () { writer.end(function () { self._flushing--; - self.emit('file', part.name, file); + self.emit('file', part.name + ':' + file.name, file); self._maybeEnd(); }); });