Results 1 to 1 of 1

Thread: downloading the file problems

  1. #1
    Join Date
    May 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: downloading the file problems

    I am getting 403 error even I can download through the web.

    Am I doing this wrong ?

    the reply from finished()

    Qt Code:
    1. if (_reply->error() || replyCode != 200) {
    2. qDebug() << _reply->errorString() << " code: " << replyCode;
    3. return;
    4. }
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. void DownloadFromServer::GetTheFile() {
    2.  
    3. qDebug() << "DownloadFromServer::GetTheFile()";
    4.  
    5. QUrl url(_url);
    6. QNetworkAccessManager *http = new QNetworkAccessManager(this);
    7. QNetworkRequest request(url);
    8. _reply = http->get(request);
    9.  
    10. connect(_reply, SIGNAL(finished()), SLOT(finished()));
    11. connect(_reply, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64)));
    12.  
    13. qDebug() << "DownloadFromServer::GetTheFile() " << url.toString();
    14.  
    15. _loop.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 


    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()
    Last edited by migel; 7th June 2011 at 18:30.

Similar Threads

  1. Playing file with Phonon while stil downloading it.
    By alexandernst in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2011, 12:25
  2. Downloading file over https with proxy
    By szraf in forum Qt Programming
    Replies: 0
    Last Post: 5th April 2011, 17:56
  3. File size of a remote file without downloading it
    By dirkdepauw in forum Qt Programming
    Replies: 5
    Last Post: 4th November 2010, 10:48
  4. Replies: 1
    Last Post: 20th April 2010, 09:14
  5. Problems with executing the *.exe file
    By iksarp in forum Newbie
    Replies: 14
    Last Post: 28th February 2010, 06:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.