I am working on a project where I need to access FTP server using its domain, username and password. I want to save data
This is my code, but it does not work. I'm using the Apache Commons FTP Library. Can you help me? Thank you!
FTPClient client = new FTPClient();
try {
client.connect("1.2.3.4");
client.login("USERNAME", "PASSWORD");
String filename = "file1.txt";
FileInputStream fis = null;
fis = new FileInputStream(filename);
client.storeFile(filename, fis);
client.logout();
fis.close();
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Log.i("tag", "SocketException");
} catch (IOException e) {
// TODO Auto-generated catch block
Log.i("tag", "IOException");
}
Error:
could not find class 'org.apache.commons.net.ftp.FTPClient'