[SOLVED] How can I get a list of my Files and Folders on my ftp Server?
I know how to connect and upload a file, but not how to get the directory list:
Use this code and it should help
FTPFile[] ftpDirs = mFTPClient.listDirectories();
for (int i = 0; i < ftpDirs.length; i++) {
toppath = ftpDirs[0].getName();
Log.d("CONNECT", "Directories in the ftp server are "
+ ftpDirs[i].getName());
}
FTPFile[] ftpdirs2 = mFTPClient.listFiles(toppath);
for (int i = 0; i < ftpdirs2.length; i++) {
Log.d("CONNECT",
"File i need is " + ftpdirs2[i].getName());
}