richardgirges / express-fileupload

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

Umlaut in filenames #325

Closed remoreichsoellner closed 2 years ago

remoreichsoellner commented 2 years ago

Hey there, today I encountered a problem while uploading files to my backend. Somehow Umlauts like "äüö" in the filenames are being replaced by weird things like "äüö". First i thought the database was the cause, but inserting Umlauts into the database is no problem, also the request sent from the web-browser states the actual, correct filename.

I noticed that when accessing the files name via request.files.<fieldName / file>.name the actual name was already replaced by those weird things mentioned above. Is there any encoding setting i missed, or is this a compatibility issue?

Thanks in advance.

remoreichsoellner commented 2 years ago

Issue can be fixed by decoding the filename with utf8.decode(string) using utf8 package from npm There is also a package called utf-8, thats the wrong one.