diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-12-09 15:29:57 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-12-09 16:23:58 +0200 |
commit | ca731cef893d4bdee8eab60c4e279ec3b83aba0d (patch) | |
tree | c68b61c42f6ae07a3696a43e07fbd65251839e38 /qt-ui | |
parent | 70fce6ce6b37ea0372ea8072fcea3672344d43a4 (diff) | |
download | subsurface-ca731cef893d4bdee8eab60c4e279ec3b83aba0d.tar.gz |
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>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 3b1b25443..952927e8c 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -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); |