From ca731cef893d4bdee8eab60c4e279ec3b83aba0d Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 9 Dec 2013 15:29:57 +0200 Subject: 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 Signed-off-by: Lubomir I. Ivanov --- qt-ui/subsurfacewebservices.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2