Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.7k views
in Java FTP by (380 points)
Hello,

I've got a problem with the put () and get () commands. Basically, when either one of them is called, the server recognises the preceding PASV and TYPE I commands coming through, but the STOR (for instance) command doesn't seem to have been received.

This is the code I'm using:

ftpc.setConnectMode(FTPConnectMode.PASV);
ftpc.setType(FTPTransferType.BINARY);

log.info("Putting file");

fileName = "C:\\Documents and Settings\\K and Stu\\My Documents\\guide.txt";
ftpc.put(fileName, "test.txt");

Thanks in advance,


K

8 Answers

0 votes
by (51.6k points)
Could you please post the relevant portion of the log file? Instructions for generating logs are in the Developer's Guide.

- Hans (EDT)
0 votes
by (380 points)
DEBUG [Backup] 10 Jul 2006 21:32:57.984 : Connecting
INFO [Backup] 10 Jul 2006 21:32:57.984 : Connection
DEBUG [com.enterprisedt.net.ftp.FTPClient] 10 Jul 2006 21:32:57.984 : Connecting to localhost/127.0.0.1:21
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:32:57.984 : 220 server ready.
DEBUG [Backup] 10 Jul 2006 21:33:04.656 : uploading
INFO [Backup] 10 Jul 2006 21:33:04.656 : put
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:04.671 : ---> TYPE I
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:04.671 : 200 type set
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:04.671 : ---> PASV
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:04.671 : 220 server ready.
DEBUG [com.enterprisedt.net.ftp.FTPClient] 10 Jul 2006 21:33:04.671 : Transferred 0 bytes to remote host
DEBUG [Backup] 10 Jul 2006 21:33:14.703 : Listener log:
220 server ready.
---> TYPE I
200 type set
---> PASV
220 server ready.
---> TYPE I
220 server ready.
---> TYPE I
200 type set
---> PASV
220 server ready.
---> QUIT
200 type set
220 server ready.
---> TYPE I
200 type set
---> PASV
220 server ready.

DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:14.703 : ---> QUIT
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 10 Jul 2006 21:33:14.703 : 220 server ready.
0 votes
by (162k points)
This is a really weird looking log.

Try command line FTP (e.g. ftp.exe), log in and type 'debug' to switch debugging on. Then transfer a file and post the log here.
0 votes
by (380 points)
INFO [com.enterprisedt.net.ftp.FTPClient] 11 Jul 2006 20:32:53.890 : edtFTPj version: 1.5.2
INFO [com.enterprisedt.net.ftp.FTPClient] 11 Jul 2006 20:32:53.906 : edtFTPj build timestamp: 20-Sep-2005 10:43:01 BST
DEBUG [com.enterprisedt.net.ftp.FTPClient] 11 Jul 2006 20:32:56.828 : Connecting to localhost/127.0.0.1:21
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:32:56.890 : 220 server ready.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:33:02.281 : ---> TYPE A
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:33:02.281 : 200 type set
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:33:02.281 : ---> PASV
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:33:02.281 : 220 server ready.
DEBUG [com.enterprisedt.net.ftp.FTPClient] 11 Jul 2006 20:33:02.281 : Transferred 0 bytes to remote host
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 11 Jul 2006 20:33:05.546 : ---> QUIT

Not much different :-(
0 votes
by (162k points)
Sorry, i meant the command line tool that comes with windows. You can switch debug on for it.
0 votes
by (380 points)
Going through the windows command line, the put option just sticks:

ftp> open
To
Usage: open host name [port]
ftp>
ftp> debug
Debugging On .
ftp> open
To localhost
Connected to SlapTop.
220 server ready.
User (SlapTop:(none)): guest
---> USER guest
331 Password
220 server ready.
ftp> put
Local file c:\code.txt
Remote file c:\test.txt
---> PORT 127,0,0,1,6,56
200 PORT command successful
220 server ready.
---> STOR c:\test.txt
150 Binary data connection (sticks here)
0 votes
by (162k points)
Looks like a routing problem, perhaps it's your firewall. XP firewall blocking FTP perhaps?


Going through the windows command line, the put option just sticks:
0 votes
by (380 points)
Tis strange. I did think of the firewall, but I couldn't see anything in the log report. Another FTP program I downloaded works with nps. I'll try running the program from my desktop, and see if I get different results!

Thanks!

Categories

...