i use edtftpj 2.0.4 to send small files from many machines to one ftp server ... i keep on finding not-sending machine everyday with different error occured such as:
note: errors below happened when the machine is retrying to send:
1.
<Wed Mar 30 23:44:33 SGT 2011>Connection reset
<Wed Mar 30 23:44:33 SGT 2011>Connection reset by peer: socket write error
2.
<Wed Mar 30 23:35:58 GMT+07:00 2011>Control channel unexpectedly closed ('' read so far)
3.
<Thu Mar 31 00:07:18 GMT+07:00 2011>Software caused connection abort: recv failed
<Thu Mar 31 00:07:18 GMT+07:00 2011>Software caused connection abort: socket write error
4.
<Wed Mar 30 22:54:05 GMT+07:00 2011>Connection timed out.
[b]note: error below happened right before the file is about to send (connected successfully)[/b]
5. <Wed Mar 30 23:15:56 GMT+07:00 2011>Permission denied *the previous day, the machine [b]successfully [/b]sent the files as it's controlled by a scheduler so there is no way that the username or password changed*
what am i supposed to do? could you please tell me what is going on for each error listed above? thank you very much and i really appreciate your help..
Regards,
Novi
this is the code of preparing and sending process:ftpConnect ftpCli = null;
if(subDir.length() == 0) {
ftpCli = new ftpConnect(ipAddr, username, password);
} else {
ftpCli = new ftpConnect(ipAddr, username, password, subDir);
}
if(!ftpCli.ftp.connected()) {
ftpCli.createTimeredConnect(ipAddr, username, password, subDir);[i] --> a call to timeredConnect method as i wrote below[/i]
}
for (int ctr = 0;ctr<files;ctr++) {
String fileToSend = pathsumberfilenameToSend+"\\"+contentsfilenameToSend[ctr].getName();
String filenameToSend = contentsfilenameToSend[ctr].getName();
String fileToSendZIP = pathsumberfilenameToSend+"\\"+contentsfilenameToSend[ctr].getName()+".zip";
String filenameToSendZIP = contentsfilenameToSend[ctr].getName()+".zip";
try {
f.zipFile(fileToSend, fileToSendZIP);
}
catch(Exception e) {
FileIO.Writelog(e.getLocalizedMessage());
}
ftpCli.setLocalRemoteFile(fileToSendZIP, filenameToSendZIP);
boolean b;
if(!ftpCli.ftp.connected()) {
ftpCli.ftp.connect();
}
b = ftpCli.doUpload();
Long SizeRemote = ftpCli.ftp.size(filenameToSendZIP);
Long SizeLocal = f.getFileSize(fileToSendZIP);//Upload
if((SizeRemote < SizeLocal) || (!b)) { //kalo gagal upload, coba sampe 5 kali
ftpCli.ftp.login(username, password);
if(subDir.length() != 0) {
ftpCli.ftp.chdir(subDir);
}
ftpCli.createTimeredUpload(fileToSendZIP, filenameToSendZIP);[i] --> a call to TimeredUpload class as i wrote below[/i]
if(ftpCli.TU.success) {
f.deleteFile(fileToSend);
f.deleteFile(fileToSendZIP);
}
}
if(b) {
f.deleteFile(fileToSend);
f.deleteFile(fileToSendZIP);
}
} ftpCli.ftp.quit();
[i][b]this is the code of doUpl[/i]oad[/b]
public boolean doUpload(){
try {
if(ftp.exists(remotefile)){
FileIO.Writelog("File "+remotefile+" has already existed");