Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Qt QNetworkReply下载进度ByTestTotal=-1_Php_Qt_Download - Fatal编程技术网

Php Qt QNetworkReply下载进度ByTestTotal=-1

Php Qt QNetworkReply下载进度ByTestTotal=-1,php,qt,download,Php,Qt,Download,我每次都收到ByTestTotal=-1。我尝试了标题('Content-Length:'。strlen($Content))在我的php文件中,但没有结果什么php标题或其他东西可以帮助您?解决方案标题是: void QNetworkReply::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) [signal] // The bytesReceived parameter indicates the number of by


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

解决方案标题是:

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.
header("Content-type: application/octet-stream");
header("Content-length: ".strlen($content));