18 bool isEmpty()
const {
return _headers.isEmpty(); }
19 QByteArray header(
const QByteArray &headerName)
const;
20 void setHeader(
const QByteArray &headerName,
const QByteArray &value);
21 QByteArray contentDispositionParameter(
const QByteArray &name)
const;
22 QByteArray dataName()
const;
23 QString originalFileName()
const;
26 static QMap<QByteArray, QByteArray> parseHeaderParameter(
const QByteArray &header);
29 static int skipWhitespace(
const QByteArray &text,
int pos);
30 QList<QPair<QByteArray, QByteArray>> _headers;
44 QByteArray
header(
const QByteArray &headerName)
const {
return _entity.first.header(headerName); }
45 QByteArray
dataName()
const {
return _entity.first.dataName(); }
46 QString contentType()
const;
47 int64_t fileSize()
const;
49 bool renameUploadedFile(
const QString &newName,
bool overwrite =
false, QFile::Permissions permissions = DefaultPermissions);
50 QString uploadedFilePath()
const;
54 QPair<TMimeHeader, QString> _entity;
64 TMultipartFormData(
const QByteArray &formData,
const QByteArray &boundary, TActionContext *context);
65 TMultipartFormData(
const QString &bodyFilePath,
const QByteArray &boundary, TActionContext *context);
69 bool hasFormItem(
const QString &name)
const;
70 QString formItemValue(
const QString &name)
const;
71 QStringList allFormItemValues(
const QString &name)
const;
72 QVariantList formItemVariantList(
const QString &key)
const;
73 QVariantMap formItems(
const QString &key)
const;
74 QVariantMap formItems()
const;
76 QString contentType(
const QByteArray &dataName)
const;
77 QString originalFileName(
const QByteArray &dataName)
const;
78 int64_t size(
const QByteArray &dataName)
const;
79 bool renameUploadedFile(
const QByteArray &dataName,
const QString &newName,
bool overwrite =
false, QFile::Permissions permissions = DefaultPermissions);
80 QString uploadedFilePath(
const QByteArray &dataName)
const;
83 bool hasEntity(
const QByteArray &dataName)
const;
84 TMimeEntity entity(
const QByteArray &dataName)
const;
85 QList<TMimeEntity> entityList(
const QByteArray &dataName)
const;
88 void parse(QIODevice *dev, TActionContext *context);
92 QByteArray parseContent(QIODevice *dev)
const;
93 QString writeContent(QIODevice *dev, TActionContext *context)
const;
95 QByteArray dataBoundary;
96 QList<QPair<QString, QString>> postParameters;
97 QList<TMimeEntity> uploadedFiles;
The THttpRequest class contains request information for HTTP.
Definition thttprequest.h:34
The TMimeEntity represents a MIME entity.
Definition tmultipartformdata.h:34
const TMimeHeader & header() const
Returns a reference to the MIME header contained in this entity.
Definition tmultipartformdata.h:42
QByteArray header(const QByteArray &headerName) const
Returns the value of the header headerName contained in this entity.
Definition tmultipartformdata.h:44
QString originalFileName() const
Returns the original name of the file contained in this entity.
Definition tmultipartformdata.h:48
TMimeEntity()
Definition tmultipartformdata.h:38
static const QFile::Permissions DefaultPermissions
Definition tmultipartformdata.h:36
TMimeHeader & header()
Returns a reference to the MIME header contained in this entity.
Definition tmultipartformdata.h:43
QByteArray dataName() const
Returns the parameter 'name' of the header field content-disposition in this entity.
Definition tmultipartformdata.h:45
#define T_CORE_EXPORT
Definition tdeclexport.h:28