[Interest] Can't download file with QNetworkAccessManager: "connection closed"

Nikos Chantziaras realnc at gmail.com
Sun Jun 8 05:05:20 CEST 2014


On 08/06/14 02:57, Thiago Macieira wrote:
> Em dom 08 jun 2014, às 02:49:53, Nikos Chantziaras escreveu:
>> I have a weird problem. I am unable to download a file from a specific
>> server (ran by sourceforge) using QNetworkAccessManager and
>> QNetworkRequest. Example:
>>
>>
>>     this->fNetManager = new QNetworkAccessManager(this);
>>     connect(this->fNetManager, SIGNAL(finished(QNetworkReply*)),
>>             SLOT(fReplyFinished(QNetworkReply*)));
>>
>>     QNetworkRequest request(QUrl("http://qtads.sf.net/COPYING"));
>>
>>     this->fReply = this->fNetManager->get(request);
>>     connect(this->fReply, SIGNAL(error(QNetworkReply::NetworkError)),
>>             SLOT(fErrorOccurred(QNetworkReply::NetworkError)));
>
> How are you handling the redirection?

It fails even without the redirection. I only used "sf.net" instead of 
"sourceforge.net" in order to make the code smaller for posting here. So 
this will also fail:

   QNetworkRequest request(QUrl("http://qtads.sourceforge.net/COPYING"));





More information about the Interest mailing list