The "Range" option in QHttpRequestHeader
Code:
#include <QtCore/QCoreApplication>
#include <qtGUI/QMessageBox>
#include <QHttp>
#include <QHttpRequestHeader>
#include <QFile>
#include <QFileInfo>
#include <QUrl>
int main(int argc, char *argv[])
{
QString qsUrlLink
= "http://cpowone.com/Embedded%20Systems.rar";
QString qsFileName
= qfFileInfo.
fileName();
if (qsFileName.isEmpty())
qsFileName = "index.html";
QUrl quSubjectUrl
(qsUrlLink
);
QString qsHost
= quSubjectUrl.
host();
qhHeader->setValue("Host", qsHost);
qhHeader
->setValue
("Content-Range",
QString("bytes=1-1024"));
hHttp->setHost(qsHost, 80);
qfFileOut
= new QFile(qsFileName
);
delete qfFileOut;
qfFileOut = 0;
return 0;
}
hHttp->request(*qhHeader,0,qfFileOut);
return a.exec();
}
i download file on internet but it error beacause it cant download form http://cpowone.com/Embedded%20Systems.rar
can you help me ?
http://c.upanh.com/upload/5/367/CS0.9522995_1_1.png
Re: The "Range" option in QHttpRequestHeader
when i download html then it download oK,Ex i download link : http://www.qtforum.org/article/17312...-not-work.html
but when i download binary file it error