墨香年少 32 发布于 2022年4月29日 handle = new QFile(file); handle->open(QIODevice::ReadOnly); QByteArray byte_file = handle->readAll(); QNetworkRequest request(url); request.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("application/octet-stream")); QString disposition = QString("form-data; file_size=\"%1\"").arg(QString::number(file_size)); request.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(disposition)); reply = AccessManage->post(request,byte_file); connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),this,SLOT(loadError(QNetworkReply::NetworkError))); connect(reply, SIGNAL(uploadProgress(qint64 ,qint64)), this, SLOT(loadProgress(qint64 ,qint64))); 目之所及,皆是回忆,心之所想,皆是过往 分享这篇帖子 链接帖子 分享到其他站点