I have used curl to upload an image file Penguins.jpg
. For example:
C:\curl>curl -vX PUT -H "Content-Type: image/jpeg" http://localhost:5984/DBNAME/DOCID/Penguins?rev=LATEST_REVISION --data-binary @Penguins.jpg
and it worked...
So, how can I achieve the same using ibrowse? ===============================
Naturally, a file upload is an
HTTP POST
. Now lets first write piece of Erlang code which doesHTTP/1.1 POST with Ibrowse
.From there, lets do our Couch DB thing.
There you go ! All you need to do is to customize your Macro
Link
to fit your couch DB settings and you're good to go !