Important: Please read the Qt Code of Conduct -

problem in download a direct link using QNetworkAcessManager

  • 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" no protocol:

    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

  • Lifetime Qt Champion


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

Log in to reply