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 could I build a ftp server by Qt5?
QtWS25 Last Chance

How could I build a ftp server by Qt5?

Scheduled Pinned Locked Moved Solved General and Desktop
networkingftp
11 Posts 3 Posters 4.6k 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.
  • T Offline
    T Offline
    tham
    wrote on 31 Oct 2018, 04:25 last edited by
    #1

    As the title mentioned, I would like to build a ftp server which listen to ip camera(send stream by ftp protocol), I have found that QNetworkAccessManager can download the data from ftp protocol, but cannot find any data mention about how to create a ftp server by Qt5, old QFtp or curl, all of them only show you how to create a ftp client.

    The simplest solution I can come up is download the stream from the ip camera periodic, is this the right thing to do? Thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 31 Oct 2018, 04:29 last edited by
      #2

      Qt has noting for specifically to ftp & not required as well.
      You need to write your own server using the Sockets. I'm not very sure why you would like to develop your own server. There are so many open source server already there and they will do the job for you. You need to only write a client. You may get a openSource C++ ftp client as well. Just you can integrate the same.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      T 1 Reply Last reply 31 Oct 2018, 04:50
      3
      • D dheerendra
        31 Oct 2018, 04:29

        Qt has noting for specifically to ftp & not required as well.
        You need to write your own server using the Sockets. I'm not very sure why you would like to develop your own server. There are so many open source server already there and they will do the job for you. You need to only write a client. You may get a openSource C++ ftp client as well. Just you can integrate the same.

        T Offline
        T Offline
        tham
        wrote on 31 Oct 2018, 04:50 last edited by tham
        #3

        @dheerendra said in How could I build a ftp server by Qt5?:

        I'm not very sure why you would like to develop your own server. There are so many open source server already there and they will do the job for you.

        Do you mean open source server like FileZilla? Or there exist open source c++ ftp server library worth to recommend?

        Have suggested them to use open source software like FileZilla, problems are

        1. QFileSystemWatcher do not guarantee it can "capture" every files change in the directory
        2. There is no way to check the file is written complete except of polling
        3. They want simple ui
        4. Extra benefits, process the frame directly without writing/reading them to harddisk is more efficient

        1, 2 could be solved if I scan the folder periodic and keep the record, although this solution do not sound efficient.

        @dheerendra said in How could I build a ftp server by Qt5?:

        You need to only write a client

        Do you mean download the stream from the ip camera periodic?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dheerendra
          Qt Champions 2022
          wrote on 31 Oct 2018, 04:54 last edited by
          #4

          Yes, I'm talking about the software like FileZill or winSCp or something. I have not used any.

          Just curious. Do you want take the frames from IPCamera and display it ? If that is the case why FTP server required ? Camera vendor should be providing the way to fetch the frames and give the frames.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tham
            wrote on 31 Oct 2018, 05:29 last edited by
            #5

            @dheerendra said in How could I build a ftp server by Qt5?:

            Just curious. Do you want take the frames from IPCamera and display it ?

            Yes

            @dheerendra said in How could I build a ftp server by Qt5?:

            If that is the case why FTP server required ? Camera vendor should be providing the way to fetch the frames and give the frames.

            This is the first time I try to capture the frame IP camera which transfer frame by ftp protocol, so I am not sure which solution is the right one to pick. The reason I want to create a ftp server is because I think the ftp server do not need to download the frame by setting the duration manually, it listen to the client and download the frame when there are new one, maybe this would less likely to missed frames(I could be wrong).

            Would try with QNetworkAccessManager to download the frames first, if not work, find another way, I like simple solution.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tham
              wrote on 31 Oct 2018, 06:56 last edited by
              #6

              Definitely need a ftp server, because the camera would upload the frames to ftp server, I cannot expect customers would like to learn how to setup ftp servers by themselves.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dheerendra
                Qt Champions 2022
                wrote on 31 Oct 2018, 07:08 last edited by dheerendra
                #7

                Your interest is that whenever camera uploads the file to ftp server, you would like to download to your app. If that is the case, you must have ftp server communicating to you. I'm not aware of any ftp server doing this. For this you must have filewatcher at your server and which indicates that new file has come.

                Another option could be setup the web server itself as ftp server and look for RSS feeds from web-server.

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                1 Reply Last reply
                3
                • D Offline
                  D Offline
                  dheerendra
                  Qt Champions 2022
                  wrote on 14 Nov 2018, 03:41 last edited by
                  #8

                  @tham did you put your own ftp server or web server ?

                  Dheerendra
                  @Community Service
                  Certified Qt Specialist
                  http://www.pthinks.com

                  T 2 Replies Last reply 16 Nov 2018, 06:13
                  0
                  • D dheerendra
                    14 Nov 2018, 03:41

                    @tham did you put your own ftp server or web server ?

                    T Offline
                    T Offline
                    tham
                    wrote on 16 Nov 2018, 06:13 last edited by
                    #9

                    @dheerendra

                    1. I found a ftp server developed by Qt on github, would use it for the project first.
                    2. There are another critical tasks on queue right now, this good to have feature need to wait until the other tasks are done
                    beeckscheB 1 Reply Last reply 16 Nov 2018, 12:53
                    0
                    • T tham
                      16 Nov 2018, 06:13

                      @dheerendra

                      1. I found a ftp server developed by Qt on github, would use it for the project first.
                      2. There are another critical tasks on queue right now, this good to have feature need to wait until the other tasks are done
                      beeckscheB Offline
                      beeckscheB Offline
                      beecksche
                      wrote on 16 Nov 2018, 12:53 last edited by
                      #10
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • D dheerendra
                        14 Nov 2018, 03:41

                        @tham did you put your own ftp server or web server ?

                        T Offline
                        T Offline
                        tham
                        wrote on 8 Dec 2018, 02:38 last edited by
                        #11

                        About this project, I use the lib found on the github as I mentioned before. It works well and quite easy to adjust the codes for my own requirements.

                        One bug I found about this lib is it do not delete the resource if clients disconnected(maybe not a big issue for the author so he did not fix it), you need to handle that part by yourself. If you need to have multiple keys, I suggest boost::multiindex, although the api is a bit complicated, it is easy to use and help us write clean codes.

                        If my customers allowed, I would put the version after alternate to github.

                        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