m4nuC / async-busboy

Promise based multipart form parser for KoaJS
MIT License
167 stars 58 forks source link

filePromises not passing to custom onFile #29

Closed men232 closed 3 years ago

men232 commented 6 years ago

Have issue with filePromises. This arg not passing to custom onFile callback

m4nuC commented 6 years ago

Can you share a code sample summarising your use case ?

men232 commented 6 years ago

It does not make sense, just look here:

    // index.js
    busboy
      .on('field', onField.bind(null, fields))
      .on('file', customOnFile || onFile.bind(null, filePromises))

Base on your docs, filePromises should be passed to customOnFile callback.

const {fields} = await asyncBusboy(ctx.req, {
    onFile: function(filePromises, fieldname, file, filename, encoding, mimetype) {
        uploadFilesToS3(file);
    }
  });
m4nuC commented 6 years ago

I am still not getting what is your issue. Can you post the actual code ?