#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();
}
#include <QtCore/QCoreApplication>
#include <qtGUI/QMessageBox>
#include <QHttp>
#include <QHttpRequestHeader>
#include <QFile>
#include <QFileInfo>
#include <QUrl>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);//_______
QString qsUrlLink = "http://cpowone.com/Embedded%20Systems.rar";
QFileInfo qfFileInfo(qsUrlLink);
QString qsFileName = qfFileInfo.fileName();
if (qsFileName.isEmpty())
qsFileName = "index.html";
QUrl quSubjectUrl(qsUrlLink);
QHttp *hHttp = new QHttp();
QHttpRequestHeader *qhHeader = new QHttpRequestHeader("GET", quSubjectUrl.path());
QString qsHost = quSubjectUrl.host();
qhHeader->setValue("Host", qsHost);
qhHeader->setValue("Content-Range", QString("bytes=1-1024"));
hHttp->setHost(qsHost, 80);
QFile *qfFileOut;
qfFileOut = new QFile(qsFileName);
if(!qfFileOut->open(QIODevice::WriteOnly)){
delete qfFileOut;
qfFileOut = 0;
return 0;
}
hHttp->request(*qhHeader,0,qfFileOut);
return a.exec();
}
To copy to clipboard, switch view to plain text mode
i download file on internet but it error beacause it cant download form http://cpowone.com/Embedded%20Systems.rar
can you help me ?
Bookmarks