Re: Multipart upload question



On 12/20/2010 05:04 PM, Jim Nelson wrote:
> I've looked over the API and I see various ways to hook into the HTTP
> request process, but I don't see an obvious way to tell Soup that, when
> it reaches a particular section of the multipart upload, to read from a
> file (or to call me via a callback/signal so I can provide it with buffers).

Right. There's no way to do that. (Well... you can make a SoupBuffer
whose contents are an mmapped file, like in
tests/simple-httpd.c:do_get(), which is a little better than reading it
all into memory ahead of time. But that's it.)

> I suppose I could generate the multipart body by hand and start
> appending SoupBuffers after "wrote-headers" and "wrote-chunk", inserting
> the file data that way, but I'd like to avoid that.

Yup, that's what you'd have to do.

Someone else was asking about the same thing recently. Having a
"streamable" multipart API would probably be useful. If you're
interested in working on that, file a bug against libsoup on
bugzilla.gnome.org and we can hash out the details of how it should work
there.

-- Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]