| 662 | } |
| 663 | |
| 664 | static void |
| 665 | addFileHttpPart(QHttpMultiPart* multiPart, |
| 666 | const QString& name, |
| 667 | const QString& filePath) |
| 668 | { |
| 669 | QFile *file = new QFile(filePath); |
| 670 | |
| 671 | file->setParent(multiPart); |
| 672 | if ( !file->open(QIODevice::ReadOnly) ) { |
| 673 | std::cerr << "Failed to open the following file for uploading: " + filePath.toStdString() << std::endl; |
| 674 | |
| 675 | return; |
| 676 | } |
| 677 | |
| 678 | QHttpPart part; |
| 679 | part.setHeader( QNetworkRequest::ContentTypeHeader, QVariant( QString::fromUtf8("text/dmp") ) ); |
| 680 | part.setHeader( QNetworkRequest::ContentDispositionHeader, QVariant( QString::fromUtf8("form-data; name=\"") + name + QString::fromUtf8("\"; filename=\"") + file->fileName() + QString::fromUtf8("\"") ) ); |
| 681 | part.setBodyDevice(file); |
| 682 | |
| 683 | multiPart->append(part); |
| 684 | } |
| 685 | |
| 686 | static QString |
| 687 | getVersionString() |
no test coverage detected