Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Can't download files with accented characters #419

Open
daquinoaldo opened this issue Jul 1, 2020 · 1 comment
Open

Can't download files with accented characters #419

daquinoaldo opened this issue Jul 1, 2020 · 1 comment

Comments

@daquinoaldo
Copy link

Hi,
thank you for this awesome project, I love it!

I'm an Italian user and I'm not able to download files with accented characters like àùòèéì. Is it possible that Droppy does not support UTF-8/16?
I found a very old but similar issue #9 marked as resolved, but I still notice this problem.
It's interesting that when uploading the file it is correctly uploaded and named with the accented letters as in the original file, only the download is affected. Moreover, I can download the folder containing the affected file without running into the bug.

@Tronic
Copy link

Tronic commented Jul 8, 2020

I'm having the same problem. It turns on that on my Mac accented characters are encoded with Unicode combining characters so that ä (U+00E4) becomes two characters ä (a + ¨, or more specifically U+0061 U+0308, or in UTF-8 61 CC 88). When uploading the file to Droppy, the same encoding is preserved on the Linux server, but in Droppy web UI it gets normalised to U+00E4, and trying to open the file by clicking it gives

2020-07-08 12:23:38 [ERROR] ENOENT: no such file or directory, stat '/srv/droppy/files/Meritähti.pdf'

By manually forming a URL like http://localhost/!/dl/Merita%CC%88hti.pdf the file can still be downloaded without errors.

Suggested fix: ensure that no Unicode normalisation occurs in URLs displayed in web UI, possibly by %-encoding any non-ASCII bytes early in the server code, prior to passing it to any other NodeJS frameworks.

Workaround for the end user: You may convert filenames on Mac or Linux by convmv tool. NFC is that shorter form that avoids combining characters and that should work with Droppy. Note that most Mac apps prefer the NFD form instead!

convmv -f UTF-8 -t UTF-8 --nfc -r /path/to/files

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants