I want to store inline attachments along with new document. Can any body provide the java script snippet to store inline attachments. And is there any way to provide a key while attaching file.
Thanks in advance
I want to store inline attachments along with new document. Can any body provide the java script snippet to store inline attachments. And is there any way to provide a key while attaching file.
Thanks in advance
To begin, read the CouchDB attachments documentation.
For example:
my_doc
hello.html
Hello, world
You encode the content with base64.
"Hello world"
is"'SGVsbG8gd29ybGQ="
.And you create a document like this:
The only difficult part is base64 encoding. I suggest that you use the base64 script included inside CouchDB.