2012-05-24 72 views

回答

0

您可以使用此:

app.use(express.multipart({ defer: true })); 

然後,在路線:

app.post('/upload', function (request, response, next) { 
    request.form.onPart = function (part) { 
    // Default handling for non-files 
    if (!part.filename) return form.handlePart(part); 

    // part is a stream of the file 
    }; 

    request.form.parse(request, function (error) { 
    if (error) return next(error); 
    }); 
});