I make my connection in the constructor, could that cause a problem?
Here is my constructor (with connection) and the simple, upload call.
The files all appear the be fine before they are uploaded.
----------------------------------------------------------------------------------
/**
* Instantiate the FTP and connect
* @param host
* @param username
* @param password
*/
public FTP(String host, String username, String password){
this.host = host;
this.username = username;
this.password = password;
try{
client = new FTPClient(host);
print("Username: " + username);
print("Password: " + password);
client.login(username, password);
client.setConnectMode(FTPConnectMode.PASV);
client.setType(FTPTransferType.BINARY);
print("Logged into server");
// print("Moved to Backups Directory");
}
catch(Exception e){
System.err.println("Could not connect to FTP server: " + e);
e.printStackTrace();
}
}
/**
* upload this file to the given ftp server
* @param file
*/
public void upload(File file){
try{
client.put(file.getAbsolutePath(), file.getName());
}
catch(Exception e){
System.err.println("Could not upload file to FTP server: " + e);
e.printStackTrace();
}
}
----------------------------------------------------------------------------------
And here's the server messages:
----------------------------------------------------------------------------------
2004-9-23 11:15:57- (not logged in) (68.110.128.81) > 220 Welcome to WinFtp Server.
2004-9-23 11:15:57- (not logged in) (68.110.128.81) > USER BRENTBACKUPS
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 331 Password required for brentbackups
2004-9-23 11:15:57- brentbackups (68.110.128.81) > PASS **************
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 230 Logged on
2004-9-23 11:15:57- brentbackups (68.110.128.81) > TYPE I
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 200 Type set to I
2004-9-23 11:15:57- brentbackups (68.110.128.81) > SYST
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 215 UNIX Type: L8
2004-9-23 11:15:57- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,235)
2004-9-23 11:15:57- brentbackups (68.110.128.81) > LIST .
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:57- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,236)
2004-9-23 11:15:57- brentbackups (68.110.128.81) > NLST
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:57- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:58- brentbackups (68.110.128.81) > DELE C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@VerizonBill.MDI.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 250 File deleted successfully
2004-9-23 11:15:58- brentbackups (68.110.128.81) > DELE C!@DocumentsandSettings@Dad@MyDocuments@Financial@Travel@airline.txt.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 250 File deleted successfully
2004-9-23 11:15:58- brentbackups (68.110.128.81) > DELE C!@DocumentsandSettings@Dad@MyDocuments@Financial@Travel@December03VegasItinerary.html.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 250 File deleted successfully
2004-9-23 11:15:58- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,237)
2004-9-23 11:15:58- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@Travel@December03VegasItinerary.html.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:58- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,238)
2004-9-23 11:15:58- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@Travel@airline.txt.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:58- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,239)
2004-9-23 11:15:58- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@VerizonBill.MDI.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:58- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,240)
2004-9-23 11:15:58- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@QuarterlyHomeownersAssociationFee.MDI.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:58- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,241)
2004-9-23 11:15:58- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@MBNAPayment.MDI.zip
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:58- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:59- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,242)
2004-9-23 11:15:59- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@JiglooLicense.MDI.zip
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:59- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 227 Entering Passive Mode (68,110,128,81,17,243)
2004-9-23 11:15:59- brentbackups (68.110.128.81) > STOR C!@DocumentsandSettings@Dad@MyDocuments@Financial@September04BillReceipts@CoxBillPayment.doc.zip
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 150 Data connection accepted; transfer starting.
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 226 Transfer ok
2004-9-23 11:15:59- brentbackups (68.110.128.81) > PASV
2004-9-23 11:15:59- brentbackups (68.110.128.81) > 227 Ent