...<file path="/database/" name="terminal_interfaces.xml" size="15220">025a32e9a4d4f42b6333f2928d562134</file> <file path="/database/" name="terminal_product.xml" size="26287">f2ed5eb1084eb17c12ecef9aabd2cce4</file> ...
QNetworkRequest request(url); currentDownload = manager.get(request); connect(currentDownload, SIGNAL(downloadProgress(qint64,qint64)), SLOT(downloadProgress(qint64,qint64))); connect(currentDownload, SIGNAL(finished()), SLOT(downloadFinished())); connect(currentDownload, SIGNAL(readyRead()), SLOT(downloadReadyRead()));
void DownloadManager::downloadFinished(){ progressBar.clear(); output.close(); if (currentDownload->error()) { // download failed fprintf(stderr, "Failed: %s\n", qPrintable(currentDownload->errorString())); emit download_error(); } else { printf("Succeeded.\n"); ++downloadedCount; emit download_succes(); } currentDownload->deleteLater(); startNextDownload();}
C++ (Qt)QNetworkRequest header(url);int size = fileSize(); // размер частично загруженного файлаheader.setRawHeader(QByteArray("Range"), QString("bytes=%1-").arg(size).toAscii()); manager->get(header);