Если вы используете LightCouch Java API
InputStream in = // .. init stream
// save under a new document, a generated UUID is assigned as id.
Response response = dbClient.saveAttachment(in, "photo.png", "image/png");
// save to an existing document
dbClient.saveAttachment(in, "file.pdf", "application/pdf", "doc-id", "doc-rev");
// save under a new document with the given id.
dbClient.saveAttachment(in, "photo.jpeg", "image/jpeg", "doc-id", null);
// get attachment
InputStream in = dbClient.find("doc-id/photo.jpeg");
// ..
in.close(); // close the stream