Support uploading multiple files

This commit is contained in:
Raymond Feng 2013-06-27 13:50:57 -07:00
parent 27416a5c3f
commit 427f270a40
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ app.get('/', function (req, res, next) {
"<a href='/download'>List all containers</a><p>" +
"Upload to container c1: <p>" +
"<form method='POST' enctype='multipart/form-data' action='/upload/c1'>"
+ "File to upload: <input type=file name=upfile><br>"
+ "File to upload: <input type=file name=uploadedFiles multiple=true><br>"
+ "Notes about the file: <input type=text name=note><br>"
+ "<input type=submit value=Upload></form>" +
"</body></html>";
@ -70,4 +70,4 @@ app.get('/download/:container/:file', function (req, res, next) {
});
});
app.listen(app.get('port'));
app.listen(app.get('port'));

View File

@ -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();
});
});