Hi Harsha,
The 'content' parameter to put_attachment is either a file-like object
to read data from or the data itself as a binary string. If you pass a
file name it will be treated as a binary string, i.e. the attachment's
content.
However, there's no need to base64 anything if you're sending
something on the file system:
f = open(filename)
try:
db.put_attachment(doc, f, filename)
finally:
f.close()
Note that if you're adding large attachments then you should probably
look at upgrading to couchdb-python 0.7 as it streams the attachment's
data instead of reading it all into memory.
- Matt