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 ?
    Thanks.



  • 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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.