[SOLVED] How to do an FTP client with Qt5, what classes to use?



  • Hi all!

    I have looking for all forums related to FTP and Qt5, I don't know yet why Qt team recommend QNetworkAccessManager with FTP. If I am right, with QNetworkAccessManager you can only upload and download files, but not delete or list files in a directory (what I need to do), or other FTP features.
    QFtp is deprecated in Qt5 and Qt team does not recomend to use this class, but I found that people likes it and continues using it.

    Should I use QNetworkAcessManager for uploading and downloading FPT files, and other class for deleting and listing files? Do I need use QTcpSocket for deleting and listing FTP files? What is the way to go?



  • Hi and welcome to devnet!

    [quote author="katu" date="1409038385"]
    Should I use QNetworkAcessManager for uploading and downloading FPT files, and other class for deleting and listing files? Do I need use QTcpSocket for deleting and listing FTP files? What is the way to go?[/quote]

    You can use QNetworkAccessManager for download/upload. See "example":http://qt-project.org/doc/qt-5/qtnetwork-download-example.html

    There is also a separate "QtFtp":https://github.com/qtproject/qtftp module that you can build yourself.

    Qt-project folks "recommend":http://qt-project.org/doc/qt-5/sourcebreaks.html#changes-to-qt-networkto to use QtFtp if you need real FTP.



  • Thank you andreyc!!! This is what I was looking for!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.