mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue