PDA

View Full Version : Get list of files on http server with QT



xaris.papadopoulos
26th April 2017, 14:41
I have set up a simple web (http) server on my laptop using this simple instructions https://www.npmjs.com/package/http-server.

I am trying to build a http client with Qt.

There is this example http://doc.qt.io/qt-5/qtnetwork-http-example.html which however just downloads one file and does not list the files on the server.

How can I list the files that exist on the http server side? Should I use QNetworkAccessManager? How?

Also,how can start the download of files and how can I show a notification when an already downloaded file has changed on the server.

I am using Qt for the first time.

Thanks

njunwa1
29th April 2017, 21:04
Regarding the listing of available files on the server U can use the QFileInfo


QURL url = "localhost";
QFileInfo fileInfo(url.path());
QString fileName = fileInfo.fileName();