Hi All,

While creating the new document first need to create the document by using 
this document we need create new revision for upload the attachments.I 
think where it is taking some time when we have an attachment size is 14mb.

How can we create an attachment for document.getCurrentRevision();

Document document = database.createDocument();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("_id", id);
        properties.put("text", text);
        properties.put("check", Boolean.FALSE);
        properties.put("created_at", currentTimeString);
        document.putProperties(properties);
        AssetManager asset = getAssets();
        try{
            InputStream inputStream = asset.open("c.jpeg");
            InputStream inputStream1 = asset.open("a.jpg");
            InputStream inputStream2 = asset.open("d.jpg");
            InputStream inputStream3 = asset.open("e.jpeg");
           
           UnsavedRevision doc2UnsavedRev =* document.createRevision();*
            doc2UnsavedRev.setAttachment("index.jpg","image/jpeg", 
inputStream);
            doc2UnsavedRev.setAttachment("a.jpg","image/jpg", inputStream1);
            doc2UnsavedRev.setAttachment("d.jpg","image/jpg", inputStream2);
            doc2UnsavedRev.setAttachment("e.jpg","image/jpeg", 
inputStream3);

            SavedRevision doc2Rev = doc2UnsavedRev.save();

        }catch(Exception e){}

is there any alter native solution for this..or how can we  create like key 
and value (properties.put("_attachments", inputStream);)

could i get help or any suggestions. 

Thank's
prasanna

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/b398579f-b2c2-4844-9123-31f1ffbb50a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to