Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to get a list of files from a ftp server

How to get a list of files from a ftp server

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nishiokasN Offline
    nishiokasN Offline
    nishiokas
    wrote on last edited by nishiokas
    #1

    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.

    nishiokasN 1 Reply Last reply
    0
    • nishiokasN Offline
      nishiokasN Offline
      nishiokas
      wrote on last edited by
      #4
      This post is deleted!
      1 Reply Last reply
      0
      • nishiokasN nishiokas

        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.

        nishiokasN Offline
        nishiokasN Offline
        nishiokas
        wrote on last edited by
        #2
        This post is deleted!
        1 Reply Last reply
        0
        • A Offline
          A Offline
          Advanced
          wrote on last edited by Advanced
          #3

          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.

          nishiokasN 1 Reply Last reply
          0
          • nishiokasN Offline
            nishiokasN Offline
            nishiokas
            wrote on last edited by
            #4
            This post is deleted!
            1 Reply Last reply
            0
            • A Advanced

              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.

              nishiokasN Offline
              nishiokasN Offline
              nishiokas
              wrote on last edited by
              #5

              @Advanced

              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/3

              I solve this problem because I use QFtp.

              arigato!

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved