@@ -29,7 +29,7 @@ module.exports = (options, req, res, next) => {
29
29
30
30
// Build busboy options and init busboy instance.
31
31
const busboyOptions = buildOptions ( options , { headers : req . headers } ) ;
32
- const busboy = new Busboy ( busboyOptions ) ;
32
+ const busboy = Busboy ( busboyOptions ) ;
33
33
34
34
// Close connection with specified reason and http code, default: 400 Bad Request.
35
35
const closeConnection = ( code , reason ) => {
@@ -46,8 +46,9 @@ module.exports = (options, req, res, next) => {
46
46
busboy . on ( 'field' , ( field , val ) => req . body = buildFields ( req . body , field , val ) ) ;
47
47
48
48
// Build req.files fields
49
- busboy . on ( 'file' , ( field , file , name , encoding , mime ) => {
49
+ busboy . on ( 'file' , ( field , file , info ) => {
50
50
// Parse file name(cutting huge names, decoding, etc..).
51
+ const { filename :name , encoding, mimeType : mime } = info ;
51
52
const filename = parseFileName ( options , name ) ;
52
53
// Define methods and handlers for upload process.
53
54
const {
0 commit comments