FTP-plugin zero-byte upload over 3G

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
jacko9000
Junior Member
Junior Member
Posts: 8
Joined: 2013-06-30, 18:00 UTC

FTP-plugin zero-byte upload over 3G

Post by *jacko9000 »

Hi,

When I attempt to upload files to a GuildFTPd FTP server over 3G, using the FTP plugin, the uploaded file is created on the server, but is always zero bytes in size.

The file is uploaded fully over WiFi, and I can also upload the file fully over 3G using AndFTP, so it seems to be a compatibility issue between the FTP plugin and the FTP server.

I have tried v2.02 and v2.03 public beta 4 of the main app, and I am using v2.03 of the FTP plugin.

The FTP connection is passive.

There is no error message in the server log file; it states that the file was uploaded, which is not great reporting by the server, but that's another issue.

Any suggestions as to how to solve this zero-byte upload would be much appreciated. I can change the FTP server configuration, if necessary.

Thanks for your help.

Regards,
Jacko
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

1. Does it work with Total Commander for Windows? You can try it with the demo version. The FTP internals are quite similar.

2. Create a log file and check whether there is anything in the log:
a) go to the default SD-Card directory via first link on home screen
b) inside, create directory named .TotalCommander (with dot at start)
c) inside, create file log.txt with long tap on [..] button
d) close TC via menu and restart
Author of Total Commander
https://www.ghisler.com
jacko9000
Junior Member
Junior Member
Posts: 8
Joined: 2013-06-30, 18:00 UTC

Post by *jacko9000 »

Hi,

Thanks for the reply.

The Windows application works over the LAN, as I would have expected, but I am unable to test it over 3G since I am logging into the Windows machine remotely, and so I can't set up a 3G hotspot for the computer to use.

But I did produce two log files from the Android FTP plugin, one for WiFi and one for 3G. It appears that the only difference between them is that the WiFi log shows a 2759 byte upload, as expected:

2013-11-15 07:03:52 FTP:STOR urls_banned.php
2013-11-15 07:03:52 FTP:150 Opening ascii mode data connection for /Music/Development/Projects/urls_banned.php.
2013-11-15 07:03:52 FTP:Upload
2013-11-15 07:03:55 FTP:226 Transfer complete. 2759 bytes in 2 sec. (1.38 Kb/s).
2013-11-15 07:03:55 FTP:Copied /mnt/sdcard/MS/Development/Website/urls_banned.php -> /Music/Development/Projects/urls_banned.php, 2759 bytes, 1.1 kbytes/s

whereas the 3G log shows a zero byte upload:

2013-11-15 05:36:47 FTP:STOR urls_banned.php
2013-11-15 05:36:47 FTP:150 Opening ascii mode data connection for /Music/Development/Projects/urls_banned.php.
2013-11-15 05:36:47 FTP:Upload
2013-11-15 05:36:48 FTP:226 Transfer complete. 0 bytes in 0 sec. (0.00 Kb/s).
2013-11-15 05:36:48 FTP:Copied /mnt/sdcard/MS/Development/Website/urls_banned.php -> /Music/Development/Projects/urls_banned.php, 2759 bytes, 2.4 kbytes/s

However, in both log files, the following appears:

2013-11-15 05:36:41 FTP:LIST
2013-11-15 05:36:42 FTP:150 Opening ASCII mode data connection for /bin/ls (2208 bytes).
2013-11-15 05:36:42 FTP:Get directory...
2013-11-15 05:36:46 FTP:Get directory...0 file(s)
2013-11-15 05:36:47 FTP:Waiting for server...
2013-11-15 05:36:47 FTP:226 Transfer successful.

The log states that the directory contains zero files, but in fact, it contains 35 files. This may be a separate issue from the upload problem, as it does not seem to affect uploading over WiFi.

Is it possible to make the logging more verbose, to see exactly where the FTP STOR command is failing?

Regards,
Jacko
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It sounds like the provider is blocking ftp uploads over 3G, since it works over LAN. Can you try with a different FTP program for Android to verify this?
Author of Total Commander
https://www.ghisler.com
jacko9000
Junior Member
Junior Member
Posts: 8
Joined: 2013-06-30, 18:00 UTC

Post by *jacko9000 »

As explained in my initial post, I was able to upload successfully over 3G using an FTP client app for Android, called AndFTP. Because AndFTP worked, I believed the problem to be with the Total Commander FTP plugin.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I see - unfortunately I'm at the end of my knowledge now. All I can recommend now is that you use AndFTP instead of my plugin, sorry.
Author of Total Commander
https://www.ghisler.com
jacko9000
Junior Member
Junior Member
Posts: 8
Joined: 2013-06-30, 18:00 UTC

Post by *jacko9000 »

No problem. Thanks for your help.

I had been thinking that perhaps you could add a configuration option to the FTP plugin, to always use APPE instead of STOR. I have seen this solve peculiar upload problems in the past.

When using APPE, if the file does not exist on the FTP server, it simply gets created by the server. I know this method is used by several FTP clients.

If you decide to add this option, let me know and I will test it. In the meantime, I will use AndFTP.

Regards,
Jacko
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Does AndFTP use APPE? This would surprise me, because APPE would append if the target already exists.
Author of Total Commander
https://www.ghisler.com
jacko9000
Junior Member
Junior Member
Posts: 8
Joined: 2013-06-30, 18:00 UTC

Post by *jacko9000 »

AndFTP uses STOR and it works over 3G. But STOR does not work with your plugin over 3G, hence my initial suggestion was to use APPE as a workaround.

But I now remember (it was a few years ago) that the workaround offered by clients in the past was REST followed by APPE. This was used by several FTP clients, including the popular CuteFTP. It is explained in the CuteFTP user guide on the following page:

http://help.globalscape.com/help/cuteftp9/transfer_settings.htm

And if a file already exists on the server, the user should be prompted as to what action should be taken, unless a default decision has been specified in the options (i.e. overwrite or resume).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

1. Can you post more of the log, please? The important thing is the PORT or PASV command and its reply just above the STOR command. Why? You get a 0 byte file because STOR told the server to create the file, but apparently the actual data connection did not work.

2. Since the server is accessible via 3G, could you create a test account for me? This way I could test in the debugger why the upload fails. If you can do this, please send the user name and password to support at ghisler dot com.
Author of Total Commander
https://www.ghisler.com
Post Reply