richardgirges / express-fileupload

Simple express file upload middleware that wraps around busboy
MIT License
1.52k stars 259 forks source link

Bug on UTF-8 filenames #348

Closed wesleimarinho closed 1 year ago

wesleimarinho commented 1 year ago

After updating to the lasting version, from 1.2.1 to 1.4.0, I've noticed that filenames containing utf-8 characters such as 'Declaração.pdf' are not processed correctly by the express-fileupload anymore, giving wrong file name after its processing.

During the investigation of the issue, I also noticed that the bug may be related to the removal of the encoding parameter in the following commit (removed from busboy.on('file', (field, file, name, encoding, mime) => {):

https://github.com/richardgirges/express-fileupload/commit/78a66c1c44a4c3a0e2bc49b47961ef27e766f0e1

It may have an impact on mimetype as well, however, I haven't checked this out.

wesleimarinho commented 1 year ago

It was solved with an additional parameter on config:

defParamCharset: 'utf-8',