Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. problem in download a direct link using QNetworkAcessManager
QtWS25 Last Chance

problem in download a direct link using QNetworkAcessManager

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 311 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AmrCoderA Offline
    AmrCoderA Offline
    AmrCoder
    wrote on last edited by
    #1

    I'm using QNetworkAcessManager to download a pdf file from a direct link this the link here
    but it download nothing and the QByteArray size is 0 I try it on another link of mp3 files and many others and it works fine but I want to know why this link can't be downloaded I try using Curl to download it and the same problem
    so I try to do it in java but it give me an error

    Exception in thread "main" java.net.MalformedURLException: no protocol: www.proz.com/ht/profile_resources/022198_r4551c465d7a53.doc
    

    when I search on this error the solve of it was to encode it so I back again and do it in Qt and encode the URL using this

        reply = manager->get(QNetworkRequest(QUrl(QUrl(Link).toEncoded())));
        connect(reply, SIGNAL(readyRead()), this, SLOT(CollectFile()));
        connect(reply, SIGNAL(finished()), this, SLOT(DocDownloaded()));
    

    but the same problem for both java and Qt so what casue this problem and why it's not download
    Thank in advance

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The java error seems pretty clear: you didn't set the protocol e.g. http or ftp

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved