Can't transfer folders

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
nocode
500 Command not understood
Posts: 2
Joined: 2014-04-11 13:08

Can't transfer folders

#1 Post by nocode » 2014-04-11 13:42

Hi,

I'm on Ubtuntu 13.10 and use FileZilla 3.8.0 (the latest in the muench repository). I haven't been able to set up a network (yet), but I can use my HD/DVD-recorder with network and FTP capabilities to transfer files over FTP from one computer to another (with a router in between). The problem is that with FileZilla I can't transfer entire folders from my computers to the HD-recorder. I can create a folder and then select and transfer all files into that folder, but with lots of files and more complex directory-structures this is not very convenient.

I'm not much of an FTP-genius, but I've been playing around with the settings like passive transfer, binary/text, only one file at a time, replacing characters, ect, but that doesn't seem to make any difference. I don't even get any particular error, besides that after every attempt to transfer a file the connection gets closed.

When I use another FTP-client (gFTP) I can transfer entire folders just by copying the folder itself without any problem by just using the default settings in gFTP.

I created a test folder with som text-files in it and sent it in both directions (with different names: test 1, 2 and 3) and copied some of the logs:

This is what happens when I upload a directory from my computer to the HD-recorder with FileZilla (partial log), which fails:

Code: Select all

Response:	230 User logged in, proceed.
Status:	Connected
Status:	Starting upload of /media/bart/Data/Test/Test 1 and 2.txt
Command:	CWD /mnt/hd2/My Video/Video-HD/Test
Error:	Connection closed by server
Error:	File transfer failed
When downloading from my HD-recorder to a computer with FileZilla, which goes okay:

Code: Select all

Status:	Starting download of /mnt/hd2/My Video/Video-HD/Test3/Test 1 and 2.txt
Command:	PORT 192,168,8,101,158,170
Response:	200 Port command successful
Command:	RETR Test 1 and 2.txt
Response:	150 Opening data connection for directory list
Response:	226 Closing data connection.
Status:	File transfer successful, transferred 0 B in 1 second
Status:	Starting download of /mnt/hd2/My Video/Video-HD/Test3/Test.txt
Command:	PORT 192,168,8,101,194,103
Response:	200 Port command successful
Command:	RETR Test.txt
When I use gFTP it seems to create a directory first and then uses the CWD command to change to that directory and upload the files. When from Filezilla I enter the MKD command I can create a directory on the recorder as well.

This is the full log from gFTP when I upload the test-directory from a computer to the HD-recorder, which ends successfully:

Code: Select all

Loading directory listing /mnt/hd2/My Video/Video-HD from cache (LC_TIME=en_US.UTF-8)
Successfully changed local directory to /media/bart/Data/Test3
Successfully changed local directory to /media/bart/Data
CWD /mnt/hd2/My Video/Video-HD
250 File action is successful. Proceed.
PWD
257 "/mnt/hd2/My Video/Video-HD" is current working dir.
Successfully changed local directory to /media/bart/Data
MKD /mnt/hd2/My Video/Video-HD/Test3
257 Directory (/mnt/hd2/My Video/Video-HD/Test3) created.
SITE CHMOD 700 /mnt/hd2/My Video/Video-HD/Test3
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,177,127
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test3/Test 1 and 2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test3/Test 1 and 2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test3/Test 1 and 2.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,199,123
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test3/Test.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test3/Test.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test3/Test.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,141,59
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test3/Test2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test3/Test2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test3/Test2.txt
502 Command not supported.
Loading directory listing /mnt/hd2/My Video/Video-HD from server (LC_TIME=en_US.UTF-8)
PORT 192,168,8,101,158,24
200 Port command successful
LIST -aL
150 Opening data connection for directory list
226 Closing data connection.
So somehow FileZilla assumes that when it uploads to a particular directory which doesn't yet exist it's going to be created along the way or something like that, while gFTP just creates the directory first and doesn't run into the problem of non-existing directories.
But with FileZilla the other way around goes as it should go; when I copy folders from the HD-recorder to one of the computers that goes without any problem. Maybe the server on the HD-recorder has no full implementation of the FTP-protocol or command-system (it's Linux-based as well) or something like that, and therefor needs the intermediate step of actually creating a directory with a command and just disconnects when a erroneous directory is entered?

So does anyone have an idea what settings I could try or should use to get folders transferred with FileZilla to my HD-recorder, as this is the client I prefer to use? Is there maybe some "verbose-mode" setting I missed, or is there a way around this without having to create every folder manually?


Thanks for any advice,
Bart

User avatar
boco
Contributor
Posts: 26938
Joined: 2006-05-01 03:28
Location: Germany

Re: Can't transfer folders

#2 Post by boco » 2014-04-11 20:19

Your server closes the connection when FileZilla attempts to CWD into the non-existent directory. However, it must throw a proper error, not kick the client out. The error code will cause FileZilla to create that directory.
gFTP opportunistically sends the MKD command first. However, boths ways of action are perfectly valid, and the server needs to support both.

What is if you use gFTP with an already existing target directory? Because then the MKD command would throw an error, too.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

nocode
500 Command not understood
Posts: 2
Joined: 2014-04-11 13:08

Re: Can't transfer folders

#3 Post by nocode » 2014-04-11 22:03

Thanks for your reply boco.

This is what happens when I try to manually create the "Test" dir with FileZilla when it already exists:

Code: Select all

Command:	MKD Test
Response:	550 Requested action not taken.
Not really an error, but a logic response I'd say. No disconnect either.

I did some more testing as well. All logs come from gFTP.

First I upload the test-directory (with 3 test-files inside):

Code: Select all

Loading directory listing /mnt/hd2/My Video/Video-HD from cache (LC_TIME=en_US.UTF-8)
Successfully changed local directory to /media/bart/Data/Test
Successfully changed local directory to /media/bart/Data
CWD /mnt/hd2/My Video/Video-HD
250 File action is successful. Proceed.
PWD
257 "/mnt/hd2/My Video/Video-HD" is current working dir.
Successfully changed local directory to /media/bart/Data
MKD /mnt/hd2/My Video/Video-HD/Test
257 Directory (/mnt/hd2/My Video/Video-HD/Test) created.
SITE CHMOD 700 /mnt/hd2/My Video/Video-HD/Test
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,196,16
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test 1 and 2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test 1 and 2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test 1 and 2.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,134,190
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,200,55
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test2.txt
502 Command not supported.
Loading directory listing /mnt/hd2/My Video/Video-HD from server (LC_TIME=en_US.UTF-8)
PORT 192,168,8,101,187,36
200 Port command successful
LIST -aL
150 Opening data connection for directory list
226 Closing data connection.
Then I transfer the same directory while it already exists:

Code: Select all

Loading directory listing /mnt/hd2/My Video/Video-HD from cache (LC_TIME=en_US.UTF-8)
Successfully changed local directory to /media/bart/Data/Test
CWD /mnt/hd2/My Video/Video-HD/Test
250 File action is successful. Proceed.
PWD
257 "/mnt/hd2/My Video/Video-HD/Test" is current working dir.
Loading directory listing /mnt/hd2/My Video/Video-HD/Test from server (LC_TIME=en_US.UTF-8)
PORT 192,168,8,101,155,162
200 Port command successful
LIST -aL
150 Opening data connection for directory list
226 Closing data connection.
Successfully changed local directory to /media/bart/Data
CWD /mnt/hd2/My Video/Video-HD
250 File action is successful. Proceed.
PWD
257 "/mnt/hd2/My Video/Video-HD" is current working dir.
Successfully changed local directory to /media/bart/Data
Could not download /media/bart/Data/Test from local filesystem
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,183,229
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test 1 and 2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test 1 and 2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test 1 and 2.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,158,30
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test.txt
502 Command not supported.
Successfully changed local directory to /media/bart/Data
PORT 192,168,8,101,185,225
200 Port command successful
STOR /mnt/hd2/My Video/Video-HD/Test/Test2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test2.txt
502 Command not supported.
Loading directory listing /mnt/hd2/My Video/Video-HD from server (LC_TIME=en_US.UTF-8)
PORT 192,168,8,101,138,80
200 Port command successful
LIST -aL
150 Opening data connection for directory list
226 Closing data connection.
gFTP seems not able to overwrite the directory ("Could not download /media/bart/Data/Test from local filesystem"), but I don't see any attempt to create a new directory either (with the MKD command), so I don't know how opportunistic it actually is in creating directories. Then it seems to upload the files into the already existing dir without throwing any error.

Then I created another file with a different filename (this is not in lhe logs) on the server (HD-recorder), then tried to copy the directory again, and the file remains there. So the directory itself is not somehow removed and re-written. Then I uploaded a not-empty file to the server and uploaded the directory (which has the empty file with the same name Test2.txt in it) again to see if the files were actually overwritten. gFTP asks me if I want to overwrite that particular file, I confirm this, but this is actually not happening and the original file remains on the server, while there's no error shown at all, except for the chmod (permission) -error that's been thrown all the time already:

Code: Select all

STOR /mnt/hd2/My Video/Video-HD/Test/Test2.txt
150 Opening data connection for directory list
226 Closing data connection.
Successfully transferred /media/bart/Data/Test/Test2.txt at 0.00 KB/s
SITE CHMOD 600 /mnt/hd2/My Video/Video-HD/Test/Test2.txt
502 Command not supported.
And I don't know what the server actually supports. It's an embedded system with I think pretty limited implementations (it seems not to have the CHMOD command implemented either), not meant to be used as a network-drive in the way I use it. I supposed it's only meant to download recordings to a computer, not more than that. That's why it may not throw an error to which FileZilla could give an useful response and just disconnects. The manual is even more limited; that only says what the login name and standard password is and that you have to select "FTP-Server" and then "On" to let it function as an FTP-server.

So it seems I may not be able to use FileZilla for this purpose as the server might just not be set up to handle the "complexities" I'm trying to use it for. (?) That would still leave me still wondering why gFTP can create a directory and FileZilla not when uploading a directory, because when the directory already exists gFTP doesn't attempt to create another one either.

User avatar
botg
Site Admin
Posts: 35563
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Can't transfer folders

#4 Post by botg » 2014-04-12 09:06

FileZilla does create directories if needed, but never gets the chance to do so, as the server closes the connection in response to the CWD command.

Post Reply