Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [QNetworkAccessManager] retrieve a file with FTP
Forum Updated to NodeBB v4.3 + New Features

[QNetworkAccessManager] retrieve a file with FTP

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.4k Views 2 Watching
  • 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.
  • C Offline
    C Offline
    cosmoff
    wrote on last edited by
    #1

    Hello everybody,

    I want to retrieve a file from a server. I am using the class QNetworkAccessManager but I do not understant the function get(const QNetworkRequest &request). the function want an object of type QNetworkRequest but I do not understant how works the class QNetworkRequest

    How can I use the command ftp : cd and get. I tryed to do :

    QNetworkRequest request ;
    request.setUrl ( "cd /home/user/data get file.zip"  ) ;
    

    but It does not work.
    Do you have a idea ?

    thanks.

    K JKSHJ 2 Replies Last reply
    0
    • C cosmoff

      Hello everybody,

      I want to retrieve a file from a server. I am using the class QNetworkAccessManager but I do not understant the function get(const QNetworkRequest &request). the function want an object of type QNetworkRequest but I do not understant how works the class QNetworkRequest

      How can I use the command ftp : cd and get. I tryed to do :

      QNetworkRequest request ;
      request.setUrl ( "cd /home/user/data get file.zip"  ) ;
      

      but It does not work.
      Do you have a idea ?

      thanks.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @cosmoff

      Hi and welcome to devnet forums

      Best is typically to checkout one of the example already or almost doing what try to implement.

      There is the network download example being pretty close.

      Typically you can also create a web path for ftp downloads in your browser (e.g. Chrome in my case). This path may be used as url for direct download. Best try it out with the example code provided. In case of problems post some questions in the forum or possibly it has been already asked before.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      3
      • C cosmoff

        Hello everybody,

        I want to retrieve a file from a server. I am using the class QNetworkAccessManager but I do not understant the function get(const QNetworkRequest &request). the function want an object of type QNetworkRequest but I do not understant how works the class QNetworkRequest

        How can I use the command ftp : cd and get. I tryed to do :

        QNetworkRequest request ;
        request.setUrl ( "cd /home/user/data get file.zip"  ) ;
        

        but It does not work.
        Do you have a idea ?

        thanks.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by JKSH
        #3

        @cosmoff said in [QNetworkAccessManager] retrieve a file with FTP:

        request.setUrl ( "cd /home/user/data get file.zip"  ) ;
        

        The function is called setUrl(), so you must enter a URL. cd is not a URL.

        Here are examples of URLs:

        • http://www.qt.io/
        • ftp://127.0.0.1/files/

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        3
        • C Offline
          C Offline
          cosmoff
          wrote on last edited by
          #4

          thanks for your answers.

          I used the web path : request.setUrl("ftp://username:password@192.168.0.250/home/user/data/file.zip") and it works!

          thank you again !

          1 Reply Last reply
          1

          • Login

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