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. How down- and upload via ftp
QtWS25 Last Chance

How down- and upload via ftp

Scheduled Pinned Locked Moved Unsolved General and Desktop
qftpqftplist
6 Posts 2 Posters 2.9k 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.
  • A Offline
    A Offline
    Andy314
    wrote on 28 May 2016, 17:13 last edited by koahnig
    #1

    I want up- and download files to a ftp-server and scan directories for files and folder. How can I do this ?
    I found in the internet the QFtp but I cannot find this class in the current Qt 5.6 documentation.

    K 1 Reply Last reply 28 May 2016, 17:41
    0
    • A Andy314
      28 May 2016, 17:13

      I want up- and download files to a ftp-server and scan directories for files and folder. How can I do this ?
      I found in the internet the QFtp but I cannot find this class in the current Qt 5.6 documentation.

      K Offline
      K Offline
      koahnig
      wrote on 28 May 2016, 17:41 last edited by
      #2

      @Andy314

      QFtp is decrepated, but for compatibility Qt4 based applications you can add QtFtp

      The example is based on QNetworkAccessManager. However, you may use it directly or see how to create your required functionality based on QNetworkAccessManager

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

      A 1 Reply Last reply 28 May 2016, 17:52
      1
      • K koahnig
        28 May 2016, 17:41

        @Andy314

        QFtp is decrepated, but for compatibility Qt4 based applications you can add QtFtp

        The example is based on QNetworkAccessManager. However, you may use it directly or see how to create your required functionality based on QNetworkAccessManager

        A Offline
        A Offline
        Andy314
        wrote on 28 May 2016, 17:52 last edited by Andy314
        #3

        @koahnig

        The QNetworkAccessManager is only for simple up-/download of files I found out. Or this it not correct?
        It is not possible to scan for files or directories on the sever with it - or is there a way to manage this task.

        K 1 Reply Last reply 28 May 2016, 21:13
        0
        • A Andy314
          28 May 2016, 17:52

          @koahnig

          The QNetworkAccessManager is only for simple up-/download of files I found out. Or this it not correct?
          It is not possible to scan for files or directories on the sever with it - or is there a way to manage this task.

          K Offline
          K Offline
          koahnig
          wrote on 28 May 2016, 21:13 last edited by
          #4

          @Andy314

          That is what Qt 5.0 docs say:
          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.

          As noted above there is a substitute/example code for QFtp downloadable. I had used this in the past, but downloading files when you already know where they are, it is better to use QNetworkAccessManager directly. The provided module does support all of FTP commands therefore there is also a solution for LIST command.

          Here you can clone directly the QFtp section it comes with an example. At day's end I guess it is matter of taste if you want to continue to use QFtp through not supported code or if you use it as initializer for your own code.

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

          A 1 Reply Last reply 29 May 2016, 06:31
          0
          • K koahnig
            28 May 2016, 21:13

            @Andy314

            That is what Qt 5.0 docs say:
            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.

            As noted above there is a substitute/example code for QFtp downloadable. I had used this in the past, but downloading files when you already know where they are, it is better to use QNetworkAccessManager directly. The provided module does support all of FTP commands therefore there is also a solution for LIST command.

            Here you can clone directly the QFtp section it comes with an example. At day's end I guess it is matter of taste if you want to continue to use QFtp through not supported code or if you use it as initializer for your own code.

            A Offline
            A Offline
            Andy314
            wrote on 29 May 2016, 06:31 last edited by
            #5

            Hi @koahnig,
            thank you for your help.
            I dont know the files, thats the main requirement of my project, there fore I must use QtFtp. (Can not really understand why this module is removed from the current Qt version ???)

            I was able to compile it after the correction of a include error. What shall I do with the lot of output files now. Must I integrate this in my Qt current installation ?

            K 1 Reply Last reply 29 May 2016, 11:39
            0
            • A Andy314
              29 May 2016, 06:31

              Hi @koahnig,
              thank you for your help.
              I dont know the files, thats the main requirement of my project, there fore I must use QtFtp. (Can not really understand why this module is removed from the current Qt version ???)

              I was able to compile it after the correction of a include error. What shall I do with the lot of output files now. Must I integrate this in my Qt current installation ?

              K Offline
              K Offline
              koahnig
              wrote on 29 May 2016, 11:39 last edited by koahnig
              #6

              @Andy314 said:

              I dont know the files, thats the main requirement of my project, there fore I must use QtFtp.

              I do not think that this is absolutely true. Probably your thinking is FTP based, which makes it harder to get the basic idea of QNetworkAccessManager. The downloading mechanism looked strange to me in the beginning as well. Therefore, I had integrated the supplied QFtp module into Qt 5. FTP is basically technology of the 1980's. Command-driven stepping from folder to folder. Listing in between until you have navigated to the place where you had to go. This is emulated within the QFtp for Qt5.
              Anyway the actual need of QFtp is more a philosophic discussion in my opinion.
              @Andy314 said:

              I was able to compile it after the correction of a include error. What shall I do with the lot of output files now. Must I integrate this in my Qt current installation ?

              @koahnig said:

              @Andy314

              QFtp is decrepated, but for compatibility Qt4 based applications you can add QtFtp

              As already given in the first post follow the link and see the few steps.

              The example is based on QNetworkAccessManager. However, you may use it directly or see how to create your required functionality based on QNetworkAccessManager

              Your output should be basically 2 libs and 2 dlls (one for release and debug each). You can add them to your installation if you like.

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

              1 Reply Last reply
              0

              4/6

              28 May 2016, 21:13

              • Login

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