I need to download a file on the internet, I use QNetworkManager and QNetworkReply. How do I know which file to download with size is?
I need to download a file on the internet, I use QNetworkManager and QNetworkReply. How do I know which file to download with size is?
Useon your QNetworkReply. You will get content-length.Qt Code:
header(QNetworkRequest::ContentLengthHeader)To copy to clipboard, switch view to plain text mode
Don't write a post just to thank someone, use "Thanks" button.
If you need to, you can issue a HEAD request to retrieve the headers without actually receiving the content. There may be a "Content-Disposition:" header (see RFC 2183) that contains the server's recommended file name.
Bookmarks