如何一次上传多个文件,使用强大的expression方式

我正在尝试使用强大的模块上传文件。 但是,当我select多个file upload,只有第一个上传。 我是节点的新手。

这里是我的上传function

exports.uploadPhotos = function(req, res) { console.log("upload received"); var form = new formidable.IncomingForm(); form.multiples = true; form.parse(req, function(err, fields, files) { res.status(200, { 'content-type': 'text/plain' }); res.end('received upload:\n\n'); res.end(util.inspect({ fields: fields, files: files })); }); form.on('end', function(fields, files) { /* Temporary location of our uploaded file */ var temp_path = this.openedFiles[0].path; /* The file name of the uploaded file */ var file_name = this.openedFiles[0].name; /* Location where we want to copy the uploaded file */ var new_location = 'uploads/'; fs.copy(temp_path, new_location + file_name, function(err) { if (err) { console.error(err); } else { console.log("success!"); } }); }); }; 

当我打电话给我时,下面就打印出来了

 received upload: { fields: { itemPhoto: '' }, files: { upload: [ [Object], [Object] ] } } 

我应该做什么来获得所有file upload?