# Qt_httpDemo **Repository Path**: duyanjun/Qt_httpDemo ## Basic Information - **Project Name**: Qt_httpDemo - **Description**: Qt基于http post上传文件到Java服务器,java服务器采用struts框架 - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2019-06-05 - **Last Updated**: 2024-01-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Qt_httpDemo ## 一、简介:
基于QT的QNetworkAccessManager用java服务器(struts1)上传文件
重点:
> ```c++ > QHttpPart filePart; > // 重点是第2个参数filename不能少,否则服务器FormFile对象为null > filePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant(QString("form-data; name=\"%1\";filename=\"%2\"").arg("file").arg(file->fileName()))); > ```