summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-09 15:29:57 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-09 16:23:58 +0200
commitca731cef893d4bdee8eab60c4e279ec3b83aba0d (patch)
treec68b61c42f6ae07a3696a43e07fbd65251839e38 /qt-ui
parent70fce6ce6b37ea0372ea8072fcea3672344d43a4 (diff)
downloadsubsurface-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.cpp5
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);