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 doesn't post request in case of large file
Forum Updated to NodeBB v4.3 + New Features

QNetworkAccessManager doesn't post request in case of large file

Scheduled Pinned Locked Moved Unsolved General and Desktop
26 Posts 6 Posters 4.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.
  • JonBJ JonB

    @Robert-Winke
    Totally throw away observation, no idea if it has any validity: is the scope of your QNetworkRequest relevant, does it have to stay in scope while the upload is in progress?

    R Offline
    R Offline
    Robert Winke
    wrote on last edited by
    #16

    @JonB I think it should be fine as a local variable but just in case I made it a member var but it didn't help:(

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

      Hi,

      Would it be possible to provide a minimal example application and server that shows that issue ?

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

      R 2 Replies Last reply
      1
      • KroMignonK KroMignon

        @Robert-Winke It look like you hurting same issue as this one ==> https://www.kdab.com/there-and-back-again/

        R Offline
        R Offline
        Robert Winke
        wrote on last edited by
        #18

        @KroMignon I tried with the patch for that issue but it didn't help. That description is mostly just about latency issue. :(

        JonBJ 1 Reply Last reply
        0
        • R Robert Winke

          @KroMignon I tried with the patch for that issue but it didn't help. That description is mostly just about latency issue. :(

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #19

          @Robert-Winke
          If you hope for an answer here, I suggest you have a go at @SGaist's request, we need some minimal sample app to reproduce.

          1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            Would it be possible to provide a minimal example application and server that shows that issue ?

            R Offline
            R Offline
            Robert Winke
            wrote on last edited by
            #20

            @SGaist yes, I created a sandbox project for this with a working web server in python. There is a readme with instructions how to build and test it. I tried to attach the file here but I dont have enough privileges so here is a google drive link:

            https://drive.google.com/drive/folders/1lxPun_p_crKlui5KU8Q1qKBp0ue7vvok?usp=sharing

            1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Would it be possible to provide a minimal example application and server that shows that issue ?

              R Offline
              R Offline
              Robert Winke
              wrote on last edited by
              #21

              @SGaist ps the error with this web server is not the same. This time I can see the post request from wireshark but the client receives Error code: 99 Unknown error. The progress still doesn't go up to 50 (100%) but it does with the small.txt

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

                Your sample Python server does not handle post requests properly and kills the connection early.

                Once that fixed, big files are properly uploaded.

                Now the question is:
                auto prog = sent*100/(2*static_cast<double>(total));

                What does that 2 do in there ? Mathematically, you can't reach 100% with that equation unless you send twice the number of bytes.

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

                R 2 Replies Last reply
                2
                • SGaistS SGaist

                  Your sample Python server does not handle post requests properly and kills the connection early.

                  Once that fixed, big files are properly uploaded.

                  Now the question is:
                  auto prog = sent*100/(2*static_cast<double>(total));

                  What does that 2 do in there ? Mathematically, you can't reach 100% with that equation unless you send twice the number of bytes.

                  R Offline
                  R Offline
                  Robert Winke
                  wrote on last edited by
                  #23

                  @SGaist That 2 doesn't matter, I'm not expecting it to go to 100 just 50 I just forgot to remove it for this sandbox project.
                  I'll look into the python server but that's not actually the server I used for testing. The one I used is proven to be working with another client but I cannot attach that.

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Your sample Python server does not handle post requests properly and kills the connection early.

                    Once that fixed, big files are properly uploaded.

                    Now the question is:
                    auto prog = sent*100/(2*static_cast<double>(total));

                    What does that 2 do in there ? Mathematically, you can't reach 100% with that equation unless you send twice the number of bytes.

                    R Offline
                    R Offline
                    Robert Winke
                    wrote on last edited by
                    #24

                    @SGaist okay by changing the server it does seem to work but now I'm completely lost because the server I used before works too just not with my client...

                    KroMignonK 1 Reply Last reply
                    0
                    • R Robert Winke

                      @SGaist okay by changing the server it does seem to work but now I'm completely lost because the server I used before works too just not with my client...

                      KroMignonK Offline
                      KroMignonK Offline
                      KroMignon
                      wrote on last edited by
                      #25

                      @Robert-Winke said in QNetworkAccessManager doesn't post request in case of large file:

                      okay by changing the server it does seem to work

                      I am just curious to know what to you have changed in server code. At first look, I can not see what wrong with it.
                      Can you please show me the changes?

                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                      R 1 Reply Last reply
                      0
                      • KroMignonK KroMignon

                        @Robert-Winke said in QNetworkAccessManager doesn't post request in case of large file:

                        okay by changing the server it does seem to work

                        I am just curious to know what to you have changed in server code. At first look, I can not see what wrong with it.
                        Can you please show me the changes?

                        R Offline
                        R Offline
                        Robert Winke
                        wrote on last edited by
                        #26

                        @KroMignon I uploaded the new server code in the same zip

                        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