Solved How to get a list of files from a ftp server
-
Hi.
I need to get a list of files from a ftp server.
I think if I can use "LIST" command, get a list of files.
but I don't know how.manager = new QNetworkAccessManager; // get is no problem. //QNetworkReply *pReply = manager->get(QNetworkRequest("ftp://myftpserveraddress/test.txt")); //↓not working. error message is "Protocol "ftp" is unknown" //QBuffer buffer; //QNetworkReply *pReply = manager->sendCustomRequest(QNetworkRequest("ftp://myftpserveraddress/"),"LIST", &buffer);
How should I do?
thanks. -
This post is deleted! -
This post is deleted! -
Which version of Qt do you use?
If you use version below 5 you can use Qftp but if you use version 5 or upper, you can use Qt FTP add-on module that's provided for Qt 5.Qt 5 change log:
The QFtp and QUrlInfo classes are no longer exported. Use QNetworkAccessManager instead. Programs that require raw FTP or HTTP streams can use the Qt FTP and Qt HTTP compatibility add-on modules that provide the QFtp and QHttp classes as they existed in Qt 4.
-
This post is deleted! -
Thanks fore reply.
Version is 5 and I found it.
https://forum.qt.io/topic/75861/qt-5-8-how-to-get-dir-list-from-ftp-server/3I solve this problem because I use QFtp.
arigato!