So I managed to write a function to upload a whole folder to an ftp server, here is the code if anyone is searching this forum (like I did) in hope of finding a function like this:

Qt Code:
  1. void sendFolder(const QString &path,const QString &dirPath)
  2. {
  3. QTextStream cout(stdout, QIODevice::WriteOnly);
  4. QFileInfo fileInfo(path);
  5. if (fileInfo.isDir())
  6. {
  7. QString dirName = path;
  8. dirName.remove(0,dirPath.size());
  9. ftp->mkdir(dirName);
  10. QDir dir(path);
  11. QStringList entries = dir.entryList(QDir::AllEntries|QDir::NoDotAndDotDot,QDir::DirsFirst);
  12. foreach (QString entry, entries)
  13. {
  14. sendFolder(dir.filePath(entry),dirPath);
  15. }
  16. }
  17. else
  18. {
  19. QFile *file = new QFile(path);
  20. if(file->open(QIODevice::ReadOnly))
  21. {
  22. QString filename =path;
  23. filename.remove(0,dirPath.size());
  24. ftp->put(file,filename);
  25. file->close();
  26. }
  27. else cout <<"Could not open file:"<<path<<"\n";
  28. }
  29. }
To copy to clipboard, switch view to plain text mode 

The dirPath parameter contains the path to the local directory that contains the folder you want to upload.
If the directory you are trying to upload is: /home/user/mydir then dirPath should be /home/user/
Because the dirPath substring will be removed to create the directory mydir on the server.

Ok.
So now that I've got that working, I am trying to figure out how to download a whole folder from a remote ftp server into a local folder.
If anyone has some code that does that I would be very grateful to have it.
I searched this forum but couldn't find what I need.
Also the qt4 ftp example doesn't contain downloading a whole folder, only files.

Can anyone help me ?
Thanks.