divelogs.de: parsing response on upload

Lubomir I. Ivanov neolit123 at gmail.com
Mon Dec 9 04:32:55 UTC 2013


On 9 December 2013 14:18, Sergey Starosek <sergey.starosek at gmail.com> wrote:
> Lubomir,
>
> On Mon, Dec 09, 2013 at 01:24:22AM +0200, Lubomir I. Ivanov wrote:
>> i can't seem to solve the upload issue.
>> everything looks right yet the website seems to return the
>> "<FileCopy>failed</FileCopy>"
>> the local created archive is readable by both libzip and other external tools.
>> ...and we add this same file in the multipart for upload.
>
> Seems I've managed to solve this issue:
>
> while building file part of multipart you have to have filename
> attribute:
>
> setRawHeader("Content-Disposition", "form-data; name=\"userfile\"; filename=\"/tmp/test.DLD\"");
>

thanks, for looking into that!
having the filename="..." attribute makes perfect sense.

> Not sure whether it should be unique between sequential uploads.
>

in general, we generate a file with a random name and then delete it.
the same name could be passed to setRawHeader().

> Today I've cloned your 'web' branch and it segfaulted at
> zip_open_wrapped(). You can't dup FD until QFile is openned. Also libzip
> documentation states that
>
> "using zip_fdopen the archive can only be opened in read-only mode"
>

the idea of zip_open_wrapped(), was to make it reusable as we need
zip_open() in a couple of places
i will have to give this a test on linux later today. only tested on
win32 thus far.

lubomir
--


More information about the subsurface mailing list