(Using Qt 4.7) I have a function that needs to take a user input of a directory name, then loop through files in a directory by that name on an FTP server. The ftp address is constant so I have it hard-coded in. So far I have this:
QString dir_name = /*whatever the user inputs*/;
QString source = "ftp://username:password@ftp.myftpaddress.com/" + dir_name + "/";
QDirIterator it(source, QDirIterator::NoIteratorFlags);
while(it.hasNext())
{
//do things with each individual file...
}
However, when I run this it never enters the loop. I put in print statements to help debug and it keeps saying that the directory referred to by it
is empty, even though it isn't. I tried simply copy and pasting the result for source
into a browser and it is correct. I have used both FTP servers and QDirIterator before but never together, is there something special I need to do to get it to work?