[Bug]: Unicode handling bug when using web upload #1169

Closed
opened 2026-04-24 23:34:44 +02:00 by adam · 2 comments
Owner

Originally created by @mayli on GitHub (Jun 4, 2023).

Describe the issue

Uploading content with unicode folder/filename from the web results corrupted file name and chapter name.
The folder name is handled correctly though.

Steps to reproduce the issue

  1. Unzip this
    test-你好-test.zip
  2. Do folder upload in Chrome/Windows (or any browser?), upload preview is showing expected filenames.
    image
  3. Check library
    image

Audiobookshelf version

v2.2.22

How are you running audiobookshelf?

Docker

Originally created by @mayli on GitHub (Jun 4, 2023). ### Describe the issue Uploading content with unicode folder/filename from the web results corrupted file name and chapter name. The folder name is handled correctly though. ### Steps to reproduce the issue 1. Unzip this [test-你好-test.zip](https://github.com/advplyr/audiobookshelf/files/11644731/test-.-test.zip) 2. Do folder upload in Chrome/Windows (or any browser?), upload preview is showing expected filenames. ![image](https://github.com/advplyr/audiobookshelf/assets/822628/7cfb9251-218f-4876-bc2d-e77f84492569) 3. Check library ![image](https://github.com/advplyr/audiobookshelf/assets/822628/33104772-446b-4bc0-9b01-56cdc22d987a) ### Audiobookshelf version v2.2.22 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:34:44 +02:00
adam closed this issue 2026-04-24 23:34:44 +02:00
Author
Owner

@mayli commented on GitHub (Jun 4, 2023):

I feel it's due to the client is not encoding filename field properly, the webapp is sending

-----------------------------2053958995873082311542031043
Content-Disposition: form-data; name="0"; filename="test-ä½ å¥½-test/llama-羊驼-2.91.mp3"
Content-Type: audio/mpeg

And the server side saved that as-is.

The proper way to handle utf-8 filename is RFC6266, for example

Content-Disposition: form-data; name="file"; filename="foo-%c3%a4.html"; filename*=UTF-8''foo-%c3%a4.html

Found another victim of axios

@mayli commented on GitHub (Jun 4, 2023): I feel it's due to the client is not encoding filename field properly, the webapp is sending ``` -----------------------------2053958995873082311542031043 Content-Disposition: form-data; name="0"; filename="test-ä½ å¥½-test/llama-羊驼-2.91.mp3" Content-Type: audio/mpeg ``` And the server side saved that as-is. The proper way to handle utf-8 filename is [RFC6266](https://datatracker.ietf.org/doc/html/rfc6266#section-5), for example ``` Content-Disposition: form-data; name="file"; filename="foo-%c3%a4.html"; filename*=UTF-8''foo-%c3%a4.html ``` Found [another ](https://stackoverflow.com/a/72909626)[victim ](https://github.com/expressjs/multer/pull/1102)of axios
Author
Owner

@mayli commented on GitHub (Jun 4, 2023):

Fixed by #1816
image

@mayli commented on GitHub (Jun 4, 2023): Fixed by #1816 ![image](https://github.com/advplyr/audiobookshelf/assets/822628/d422c7d2-fd06-495d-96cf-9557127f3fe3)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1169