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. downloadProgress bytesTotal -1
Forum Updated to NodeBB v4.3 + New Features

downloadProgress bytesTotal -1

Scheduled Pinned Locked Moved General and Desktop
qnetworkreplyqnetworkaccessm
5 Posts 2 Posters 2.1k 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.
  • FranckynosF Offline
    FranckynosF Offline
    Franckynos
    wrote on last edited by
    #1

    Hi

    I want create progess bar when files are been download but when my files a big (32 Mo) the signal downloadProgress return -1 in bytesTotal.

    Who can I have the size of download files ?

    thanks

    1 Reply Last reply
    0
    • FranckynosF Offline
      FranckynosF Offline
      Franckynos
      wrote on last edited by
      #2

      Nobody have and idea ?

      I use QNetworkAccessManager and QNetworkReply

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by Chris Kawa
        #3

        It depends on the headers sent from the server. They may not contain that information.
        A value of -1 means the size is not determined so the download will simply progress until it's done, but you can't tell at what size that's gonna be.

        You can handle that by setting the progress to undetermined state, as described in the docs. This would display a progress animation without indicating concrete value. A more permanent fix would be server side to assure correct info is sent.

        1 Reply Last reply
        0
        • FranckynosF Offline
          FranckynosF Offline
          Franckynos
          wrote on last edited by
          #4

          Thanks for your reply.

          But there isn't way to have a real progression ? It's a bullshit to remove QFtp class.

          I can't have size of file with some request ?

          thx

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Franckynos said:

            But there isn't way to have a real progression ?

            It depends on whether or not the server sends correct Content-Length field in the header. It's not like Qt can magically guess the value if the server didn't send it.

            It's a bullshit to remove QFtp class.

            Huh. What does that out of context comment have to do with the issue?

            I can't have size of file with some request ?

            See above.

            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