Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QNetworkReply and file downloading problem
Kaluss last edited by
I experience a strange situation:
@this->connect( this->networkManager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( onDownloadingFinished( QNetworkReply* ) ) );
void UpdateMgr::onDownloadingFinished( QNetworkReply* reply )
if( reply->error() == QNetworkReply::NoError )
qDebug() << "Size of downloaded file:" << reply->size();
qDebug() << "Size of saved file:" << reply->readAll().length();
Size of downloaded file: 11902976
Size of saved file: 11894784
Casue of that I det damaged file. Why????
msue last edited by
You have to append reply->readAll to your file on each readyRead signal and close your file when the finish signal comes as it may not come all in one big chunk.