Fair enough, I want to work in the most forward-compatible way. Accessing the data directly on disk is not a requirement, but I do to look up the data bytes (NSData?) based on the name I gave the attachment. Is there a way I can do this?
On Wednesday, January 28, 2015 at 10:43:09 AM UTC-8, Jens Alfke wrote: > > > On Jan 28, 2015, at 9:54 AM, Jeff Kingyens <[email protected] > <javascript:>> wrote: > > I want to create a view that emits the keys of the _attachments hash as > the query key, and the value being the path on disk. > > > There isn't a way to do that, and accessing attachments directly as files > is discouraged. There are future changes to Couchbase Lite that would > either make it never work (i.e. if your database is encrypted), or just > sometimes not work (i.e. if we optimize by storing small attachments inline > in the database, or if we download attachments from the server on demand.) > > The only reason there's any API to get the path to an attachment file is > because there are APIs in iOS/OS X — like AVFoundation — that only take > paths as input, not NSData or NSStreams, so giving out the path was the > only way to make attachments useable with those APIs. > > —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/5aabacdf-3aa7-46bf-99d0-9dd1541d976c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
