> On Nov 9, 2014, at 8:30 PM, Abhishek Shetty <[email protected]> > wrote: > > I know that the images will get stored as base64 format.
If images are stored as document attachments, they won't be encoded in base64 in the database. It's true that if you GET the document with ?attachments=true the data will appear as base64 properties in the _attachments object, but you really don't want to do that; it's inefficient, especially with big data like images. > But the main issue I am facing is I am not being able to convert the binary > data back to viewable image . Not sure what's wrong with your code; I'm not a JavaScript expert. But it's definitely not a good way to load or display images! What you should do instead is take advantage of the fact that every attachment has its own URL: /db/docID/attachmentName. So once you have the image name all you have to do is append it to the document's URL (with a slash in between) and set that as the SRC attribute of an IMG element. —Jens -- 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/022608F8-E459-45C0-9BDC-A98A0C08CCBA%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
