Hello,
I am trying to do an upload using edtftp-2.1.0. My code works on most of the servers but when i connect to a specific server the dataconnection is closed. When using othe ftp client the server responds correctly. I tried active and passive mode.
Anybody knows what is causing this. Firewalls should be ok as filezilla can connect with it.
My code:
FileTransferClient ftc;
ftc = new FileTransferClient();
ftc.setEventListener(new Listener());
ftc.setRemoteHost("<hostname>");
ftc.setRemotePort( 21 );
ftc.setUserName("user");
ftc.setPassword("pass");
ftc.setContentType(FTPTransferType.BINARY);
ftc.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);
ftc.connect();
ftc.uploadFile("c:/temp/dummy.mxf","/OCBACI02001/toPolopoly/fromArdome/dummy.mxf",WriteMode.OVERWRITE);
Output:
IWAV0055I Java Bean test started with the main method
reply received 220 Connection ok (10.220.65.186:4438)
cmd send: ---> USER vtrsync
reply received 331 User ok, need password
cmd send: ---> PASS ********
reply received 230 User logged in
cmd send: ---> TYPE I
reply received 200 Type is I
cmd send: ---> PWD
reply received 257 "i:"
cmd send: ---> PASV
reply received 227 Entering Passive Mode (10,240,45,165,17,235)
cmd send: ---> STOR /OCBACI02001/toPolopoly/fromArdome/dummy.mxf
reply received 125 Dataconnection already open, starting
Bytes: 65536
reply received 426 Connection closed; transfer aborted
cmd send: ---> SIZE /OCBACI02001/toPolopoly/fromArdome/dummy.mxf
reply received 500 File not found
cmd send: ---> PASV
reply received 227 Entering Passive Mode (10,240,45,165,17,236)
cmd send: ---> REST 0
reply received 500 Command not recognised
com.enterprisedt.net.ftp.FTPException: 500 Command not recognised
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1216)
at com.enterprisedt.net.ftp.FTPClient.restart(FTPClient.java:2190)
at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2643)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2712)
at com.enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2451)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2419)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:802)
at test.main(test.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.ve.internal.java.vce.launcher.remotevm.JavaBeansLauncher.main(JavaBeansLauncher.java:79)
cmd send: ---> STOR /OCBACI02001/toPolopoly/fromArdome/dummy.mxf
reply received 125 Dataconnection already open, starting
Bytes: 65536
reply received 426 Connection closed; transfer aborted
cmd send: ---> SIZE /OCBACI02001/toPolopoly/fromArdome/dummy.mxf
reply received 500 File not found