Divelogs.de: Add a 'filename' field when uploading
The 'Content-Disposition' header, requires that we pass 'name' but also a 'filename' field. Suggested-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
70fce6ce6b
commit
ca731cef89
@ -557,7 +557,10 @@ void DivelogsDeWebServices::uploadDives(QIODevice *dldContent)
|
||||
{
|
||||
QHttpMultiPart mp(QHttpMultiPart::FormDataType);
|
||||
QHttpPart part;
|
||||
part.setRawHeader("Content-Disposition", "form-data; name=\"userfile\"");
|
||||
QFile *f = (QFile *)dldContent;
|
||||
QFileInfo fi(*f);
|
||||
QString args("form-data; name=\"userfile\"; filename=\"" + fi.absoluteFilePath() + "\"");
|
||||
part.setRawHeader("Content-Disposition", args.toLatin1());
|
||||
part.setBodyDevice(dldContent);
|
||||
mp.append(part);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user