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?
Printable View
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.Code:
header(QNetworkRequest::ContentLengthHeader)
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.