Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP uploading folders with special characters (such as >, :, etc.) in their names causes "ECONNRESET - Connection reset by peer" and "Page type unknown" #1334

Open
nekohayo opened this issue Nov 1, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@nekohayo
Copy link

nekohayo commented Nov 1, 2024

Hi !

With the latest version available in f-droid (1.7.4) on Android 14, I've been trying to upload a bunch of music album folders but they end up causing a bunch of incomprehensible errors in Nautilus and FileZilla when they try to copy the actual files in those folders, when the folder names have characters such as : or > in them.

The weird thing is that in the Material Files interface, and through FTP, it is quite possible to create, rename, view such folders even with special characters. It only fails to upload files to them.

For example, if I create a folder called blah : in the Music folder, and try to upload to it, for each file FileZilla reports:

Could not read from transfer socket: ECONNRESET - Connection reset by peer

Nautilus / GVFS reports:

There was an error copying the file into ftp://admin@the_phone:2121/Music/blah%20:.

Error sending data: Connection reset by peer

If you try to create a file in such a folder (instead of just copying), Nautilus' error is slightly different:

There was an error creating the directory in ftp://admin@the_phone:2121/Music/blah%20:.

Page type unknown

Given that two different types of FTP clients are choking on this in different ways, I am wondering if there is something Material Files can do to translate the paths+filenames when receiving (or creating, modifying etc.) files through FTP specifically? Otherwise, is there a way for Material Files to raise a more descriptive error for the FTP clients? Or prevent the creation of those faulty folders (instead of later failing on the files within)?

@nekohayo
Copy link
Author

nekohayo commented Nov 1, 2024

Apparently, uploading folders with such characters in their filenames also fails with similar errors even if the containing folder has no special characters, but I'm not sure what to do about files. It would still be desirable to have something more descriptive than "Connection reset by peer", if possible...

@zhanghai
Copy link
Owner

zhanghai commented Nov 1, 2024

If you are trying to put files on your SD card and your file/folder name contains special characters like :, that will fail due to stricter FAT32 file name enforcement on new Android versions. See also google/adb-sync#34 .

Maybe Material Files can provide a better error message, but Material Files shouldn't translate the file name for you because there's no canonical way to do that. You need to transform the file name properly with your own copy mechanism.

@zhanghai zhanghai self-assigned this Nov 1, 2024
@zhanghai zhanghai added the question Further information is requested label Nov 1, 2024
@fallsdevil
Copy link

@zhanghai hey, could you explain something to me? I want to add an ftp from my windows to material files, but I'm not able to, I don't know if this option is just for my smartphone to appear on Windows, or if I can actually access my Windows files on my Android and I must have configured the ftp wrongly in windows... even because in the folder that comes by default in your "ftp" app, even though "allow writing" is enabled, I can't even open or edit anything through the windows explorer, only open the browser, but empty...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants