cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Handling MultiPart response in CURL

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 18 Jul 2014 11:31:38 +0200

On Fri, Jul 18, 2014 at 02:28:33PM +0530, Prashant Pharate wrote:
> Problem is how to split multipart response.
>
> Added files in BodyParts---I tried following
>
> curl -o sal.htm -o sal.pdf
>
> But pdf garbage data get mix with html file

Right, that's how multipart works.

> Please share if you have example

I suggest you search for a library to handle it for you. See for example
this question
http://stackoverflow.com/questions/2265038/is-there-a-lightweight-multipart-form-data-parser-in-c-or-c
or this one
http://stackoverflow.com/questions/218089/simple-c-mime-parser
or many other online suggestions. I don't recall anyone suggesting one in
particular on this list, but if you find a good one, listing it on
http://curl.haxx.se/libcurl/relatedlibs.html would be a great idea.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-07-18