Closed dschmitt2 closed 2 years ago
Using busboy 1.6.0 and Firefox. (Same behavior with busboy 1.5.0 or Ungoogled Chromium)
busboy 1.6.0
busboy 1.5.0
When trying to upload a file with special Unicode characters in the name, an additional character gets injected.
For example, when uploading X©onstants.ts with the following handler:
X©onstants.ts
bb.on("file", (fieldname, stream, info) => { console.log(`Incoming name: ==${info.filename}==`); }
This is what I see:
Incoming name: ==X©onstants.ts==
From the Developer Tools I see that the original name was sent from the browser:
-----------------------------29727020558344325852980456311 Content-Disposition: form-data; name="file_content"; filename="X©onstants.ts" Content-Type: text/vnd.trolltech.linguist ...
Set defParamCharset to whatever charset you want to use to decode parameter values that don't have a version of the field with an explicit/inline charset defined. By default it decodes to a latin1 string.
defParamCharset
Using
busboy 1.6.0
and Firefox. (Same behavior withbusboy 1.5.0
or Ungoogled Chromium)When trying to upload a file with special Unicode characters in the name, an additional character gets injected.
For example, when uploading
X©onstants.ts
with the following handler:This is what I see:
Incoming name: ==X©onstants.ts==
From the Developer Tools I see that the original name was sent from the browser: