cURL / Mailing Lists / curl-library / Single Mail


RE: How to upload file as CouchDB attachment via libCurl

From: Jonathan C. <>
Date: Tue, 27 May 2014 01:31:04 +0000

> 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:
Received on 2014-05-27