MaterialFiles
MaterialFiles copied to clipboard
FTP uploading folders with special characters (such as `>`, `:`, etc.) in their names causes "ECONNRESET - Connection reset by peer" and "Page type unknown"
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)?
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...
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 https://github.com/google/adb-sync/issues/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 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...