downloadProgress bytesTotal -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



  • Nobody have and idea ?

    I use QNetworkAccessManager and QNetworkReply


  • Moderators

    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.



  • 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


  • Moderators

    @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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.