divelogs.de: parsing response on upload

Lubomir I. Ivanov neolit123 at gmail.com
Sat Dec 7 07:29:43 UTC 2013


i'm doing this is:

QFile f(filename);
if (f.exists()) {
    f.open(QIODevice::ReadOnly);
    uploadDives((QIODevice *)&f);
...

where there is a cast between a QFile and QIODevice, and this should
work given QFile is based on that class.
i'm starting to think that somehow a bad body is set for the multipart:

part.setRawHeader("Content-Disposition", "form-data; name=\"userfile\"");
part.setBodyDevice(dldContent);

for reference in GTK / SOUP we had:
https://github.com/torvalds/subsurface/blob/Gtk/webservice.c#L365

lubomir
--

On 7 December 2013 17:16, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> hello,
>
> the new upload code can be tested from here:
> git at github.com:neolit123/subsurface.git web
>
> notes:
> - there were merge conflicts with my existing branch and master.
> - you can right click a dive to call "upload to divelogs.de..."
>
> the temporary zip file is created in QDir::QDir::tempPath() and dives
> are added to it. then it is uploaded via:
> DivelogsDeWebServices::uploadDives(QIODevice *dldContent)
>
> and the transfer is reported as successful, but then this is the
> server response:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <divelogsDataImport version="1.0">
>   <Login>succeeded</Login>
>   <FileCopy>failed</FileCopy> <---------------- ?
>   <entered>0</entered>
>   <skipped>0</skipped>
>   <profiles>0</profiles>
> </divelogsDataImport>
>
> and the uploaded dive is missing in the web interface.
> any ideas?
>
> lubomir
> --


More information about the subsurface mailing list