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 To Download File With QT Service
Qt 6.11 is out! See what's new in the release blog

How To Download File With QT Service

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.0k 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.
  • Taz742T Offline
    Taz742T Offline
    Taz742
    wrote on last edited by
    #1

    Hi all..
    I wrote service, when this service is running in every 15 seconds it calls one exe file from desktop and one file must be downloaded with this exe file but it doesn't download anything

    Do what you want.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Can you please show code and details on what you are doing.

      Taz742T 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Can you please show code and details on what you are doing.

        Taz742T Offline
        Taz742T Offline
        Taz742
        wrote on last edited by
        #3

        @mrjj
        service constructor:
        p = new QProcess(this);
        p->start("C:/Users/from1/Desktop/QT_Downloader.exe");

        QT_Downloader constructor:
        QString filename = "https://sourceforge.net/p/qtlmovie/code/ci/v1.2.16/tree/build/windows-build-qt-static.ps1?format=raw";
        QUrl url1 = QUrl::fromUserInput(filename);
        m_downloader = new SimpleDownloader(url1, QDir(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)), true, this);

        Do what you want.

        mrjjM 1 Reply Last reply
        0
        • Taz742T Taz742

          @mrjj
          service constructor:
          p = new QProcess(this);
          p->start("C:/Users/from1/Desktop/QT_Downloader.exe");

          QT_Downloader constructor:
          QString filename = "https://sourceforge.net/p/qtlmovie/code/ci/v1.2.16/tree/build/windows-build-qt-static.ps1?format=raw";
          QUrl url1 = QUrl::fromUserInput(filename);
          m_downloader = new SimpleDownloader(url1, QDir(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)), true, this);

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Taz742
          Did you hook up the QProcess error signals so u can see if something is up ?

          also for the SimpleDownloader. Its important to see if any errors is reported.

          Also if you run this manually in a shell/cmd.exe

          Does it then work ?

          ps what is SimpleDownloader `?
          This class
          https://forum.qt.io/topic/5067/solved-qnetworkaccessmanager-downloads-won-t-start/9

          Taz742T 1 Reply Last reply
          1
          • mrjjM mrjj

            @Taz742
            Did you hook up the QProcess error signals so u can see if something is up ?

            also for the SimpleDownloader. Its important to see if any errors is reported.

            Also if you run this manually in a shell/cmd.exe

            Does it then work ?

            ps what is SimpleDownloader `?
            This class
            https://forum.qt.io/topic/5067/solved-qnetworkaccessmanager-downloads-won-t-start/9

            Taz742T Offline
            Taz742T Offline
            Taz742
            wrote on last edited by
            #5

            @mrjj
            yes, it works but when downloader.exe is called from service, it doesn't download anything

            Do what you want.

            Taz742T 1 Reply Last reply
            0
            • Taz742T Taz742

              @mrjj
              yes, it works but when downloader.exe is called from service, it doesn't download anything

              Taz742T Offline
              Taz742T Offline
              Taz742
              wrote on last edited by Taz742
              #6

              because I think that this service doesn't have network access

              Do what you want.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                Your code doesn't do any error handling so like @mrjj suggested: connect all error related signals to see what is happening and add proper checks.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                2

                • Login

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