Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in Java FTP by
Every time i upload a file. The results on the server are corrupted. The files that get uploaded are always slightly smaller than the amount of data i tried to upload.

// set up client
ftp = new FTPClient();
ftp.setRemoteHost(host);
FTPMessageCollector listener = new FTPMessageCollector();
ftp.setMessageListener(listener);
//ftp.setAutoPassiveIPSubstitution(true);

// connect
log.info("Connecting");
ftp.connect();

// login
log.info("Logging in");
ftp.login(user, password);

// set up passive ASCII transfers
log.debug("Setting up passive, ASCII transfers");
ftp.setConnectMode(FTPConnectMode.PASV);
ftp.setType(FTPTransferType.ASCII);


// copy file to server
log.info("Putting file");
Math.random();
ftp.put(path+originalfile, App.user+App.val+originalfile);

// Shut down client
log.info("Quitting client");
ftp.quit();

1 Answer

0 votes
by (162k points)
The real question is are they identical when you download them again?

Every time i upload a file. The results on the server are corrupted. The files that get uploaded are always slightly smaller than the amount of data i tried to upload.

Categories

...