Results 1 to 2 of 2

Thread: Get list of files on http server with QT

  1. #1
    Join Date
    Apr 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Get list of files on http server with QT

    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

  2. #2
    Join Date
    Apr 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Get list of files on http server with QT

    Regarding the listing of available files on the server U can use the QFileInfo
    Qt Code:
    1. QURL url = "localhost";
    2. QFileInfo fileInfo(url.path());
    3. QString fileName = fileInfo.fileName();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. List files on ftp server using QNetworkAccessManager
    By blackbubblegum in forum Newbie
    Replies: 2
    Last Post: 20th February 2012, 10:39
  2. errors while upload files on http server????
    By sups in forum Qt Programming
    Replies: 4
    Last Post: 25th February 2011, 23:11
  3. Sample of Http server
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 30th November 2010, 23:43
  4. mutithread in http-server
    By chuengchuenghq in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2008, 00:24
  5. Build an HTTP server
    By the_bis in forum Qt Programming
    Replies: 4
    Last Post: 30th March 2007, 07:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.