PDA

View Full Version : downloading the file problems



migel
7th June 2011, 18:30
I am getting 403 error even I can download through the web.

Am I doing this wrong ?

the reply from finished()


if (_reply->error() || replyCode != 200) {
qDebug() << _reply->errorString() << " code: " << replyCode;
return;
}




void DownloadFromServer::GetTheFile() {

qDebug() << "DownloadFromServer::GetTheFile()";

QUrl url(_url);
QNetworkAccessManager *http = new QNetworkAccessManager(this);
QNetworkRequest request(url);
_reply = http->get(request);

connect(_reply, SIGNAL(finished()), SLOT(finished()));
connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));

qDebug() << "DownloadFromServer::GetTheFile() " << url.toString();

_loop.exec();
}


Added after 1 11 minutes:

ok, so my problem is that I give the url already escaped , so now question how to disable escaping in QUrl()

Added after 8 minutes:

I am talking to my self :)

answer: url.addEncodedQueryItem()