cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to upload file as CouchDB attachment via libCurl

From: Lane <software.research.development_at_gmail.com>
Date: Tue, 27 May 2014 02:41:19 -0500

Oh, that's interesting. I see what you mean. I now wonder if there's a
limit for large files into this stream. I'll give it a try in the morning.

On Mon, May 26, 2014 at 8:31 PM, Jonathan C. <well.bad_at_hotmail.com> wrote:

>
>
> > So that curl command works on the command line and does exactly what I
> > want. What I don’t understand is how to upload the part within
> > parenthesis, the actual file. I.e., $(openssl base64 < filename). This
> > line converts the file to base64, then curl uploads it. That's the part
> > I don't understand with the API or to build into the app to upload the
> > file as part of the json object. And yes, its a huge file.
>
> From what I can tell, this is not a libcurl issue in reality.
>
> You *just* need to get the file contents (search for c++ fstream), encode
> it to base64 (there are some functions for that out there), and place it at
> the specified position in the json string. (I don't know a fast way to do
> that, since I don't know if printf like functions are good for large
> values).
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-05-27