3#include <Kanoop/http/httpoperation.h>
4#include <Kanoop/serialization/iserializabletojson.h>
14 HttpUpload(
const QString& url,
const QString& filename = QString()) :
16 _filename(filename) {}
37 QList<KeyValuePair> _parameters;
39 QHttpMultiPart* _multipart =
nullptr;
40 QFile* _file =
nullptr;
Base class for HTTP operations executed asynchronously on a dedicated thread.
HTTP multipart file upload operation executed asynchronously on a dedicated thread.
virtual void execute() override
Execute the multipart file upload.
void setFilename(const QString &value)
Set the filename to be uploaded.
void addParameter(const QString &key, const QString &value)
Add a form parameter to the multipart upload.
void uploadProgress(uint64_t sent, uint64_t total)
Emitted to report upload progress.
HttpUpload(const QString &url, const QString &filename=QString())
Construct an HTTP upload operation for the given URL and optional filename.
QString filename() const
Return the filename to be uploaded.