Qt QNetworkReply downloadProgress bytesTotal = -1

时间:2013-06-20 09:55:58

标签: php qt download

void QNetworkReply::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) [signal]

// The bytesReceived parameter indicates the number of bytes received, while bytesTotal indicates the total number of bytes expected to be downloaded. If the number of bytes to be downloaded is not known, bytesTotal will be -1.


我每次都收到bytesTotal = -1。我在我的php文件中尝试了header('Content-Length: '.strlen($content));但没有结果。什么php标题或其他什么可以帮助?

1 个答案:

答案 0 :(得分:0)

解决方案标题是:

header("Content-type: application/octet-stream");
header("Content-length: ".strlen($content));