Hello everyone
I'm writing an app that downloads data from the Internet ( like FlashGet or Download Master ). I need to resume download of a file. I use QHttp like
Maybe I should use some different function like QHttp::request ?
Printable View
Hello everyone
I'm writing an app that downloads data from the Internet ( like FlashGet or Download Master ). I need to resume download of a file. I use QHttp like
Maybe I should use some different function like QHttp::request ?
Perhaps QHttp::request() and "Content-Range" header field?
Thanks. It seems that my guess was right ;)
It's strange I'm trying to use QHttp::request like this
But it downloads the whole file not just 21010-47021 bytes :confused:Code:
http_.setHost(url.host()); header.addValue("Content-Range", "bytes 21010-47021/47022"); qDebug()<<header.toString(); http_.request(header,0, file_);
Oops, "Content-Range" is a field of server response header. I think the corresponding client request header field is actually just "Range".
i want find document funcition header.addValue("Content-Range", "bytes 21010-47021/47022");
i dont known qHeader.addValue("Range", "bytes 21010-47021/47022");
Code:
void BrowseWidgetImpl::downloadSubjectForNextThread() { { reloadCompleted(); return; } nextThreadConnection.abort(); if(nextThreadBuffer) { delete nextThreadBuffer; nextThreadBuffer = NULL; } // nextThreadBuffer.size(0); { qDebug() << "Can't open buffer in downloadSubjectForNextThread()"; return; } QHttpRequestHeader header; nextThreadConnection.setProxy(*networkProxy); nextThreadConnection.setHost(subjectUrl.host()); header.setRequest("GET", subjectUrl.path()); header.addValue("Host", subjectUrl.host()); subjectGetId = nextThreadConnection.request(header, 0, nextThreadBuffer); }