Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Content-Length Header missing?
the_ last edited by
I try to download some (binary) from a server. The request page is a php script, that returns the files according some POST variables.
my php script looks like this
<?php //read $_POST and do some PDO things returning content as blob, size as int, contenttype as varchar $filesize = $res['size']; //size is set in the database $type = $res['contenttype']; $content = $res['content']; header("Content-Length: $filesize"); header("Content-type: $type"); echo $content; ?>
If I request a file via browser (with jquery post), I get all headers, but with QNetworkAccessManager I am missing the Content-Length.
qDebug() << "header: " << r->header(QNetworkRequest::ContentLengthHeader);
qDebug() << r->rawHeaderList();
("Date", "Server", "X-Powered-By", "Vary", "Content-Encoding", "Connection", "Transfer-Encoding", "Content-Type")
Any ideas what went wrong here?