Nominate our 2022 Qt Champions!

Download a simple file

  • When i use "QDesktopServices OpenUrl" with a pdf file link ("http:\www.....fichier.pdf"), the file is well downloaded et opened with Adobe Reader for example.
    If i want to download thIs file without opening it, is there a simple command to manage it, or an example ?

  • I think you can use QNetworkAccessManager like this:

    QNetworkAccessManager* accessManager = //...
    QNetworkReply * answer = //..
    answer = accessManager->get( QNetworkRequest( QUrl( url ) ) ); 
    connect( answer , SIGNAL( finished() ), this, SLOT( downloaded() ) ); 

Log in to reply