=== modified file 'desktopcouch/addattachment.py' --- desktopcouch/addattachment.py 2010-04-04 11:03:34 +0000 +++ desktopcouch/addattachment.py 2010-05-06 01:42:48 +0000 @@ -14,8 +14,13 @@ path = sys.argv[0] db = CouchDatabase("addattachment", create=True) record = Record(record_type="url") - record.attach(path, "blob", "image/jpg") - db.put_record(record) + record.attach(open(path, "r"), "blob", "image/jpg") + _id = db.put_record(record) + # Getting it backup + rec = db.get_record(_id) + arch = open(path_new_file, "w") + arch.write(rec.attachment_data(rec.list_attachments()[0])[0]) + arch.close() else: print "Please pass the path of the jpg to add."