Support uploading multiple files
This commit is contained in:
parent
27416a5c3f
commit
427f270a40
|
@ -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'));
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue