Duplicate file names with attachments

18 views
Skip to first unread message

Todd Freese

unread,
May 14, 2014, 12:30:48 PM5/14/14
to mobile-c...@googlegroups.com
Does CBL (iOS) store attachments with their original file name? And does it store them in a single directory?

Can I have multiple attachments with the same file name across different documents without having to make sure the file names are unique? For example, doc 1 as a file attachment named "picture.jpg" and document 2 has a different picture named "picture.jpg"

I am using SG with a Couchbase backing store.

Todd

Jens Alfke

unread,
May 14, 2014, 12:55:03 PM5/14/14
to mobile-c...@googlegroups.com
On May 14, 2014, at 9:30 AM, Todd Freese <to...@filmworkers.com> wrote:

Does CBL (iOS) store attachments with their original file name? And does it store them in a single directory?

No, and Yes. It stores them in a single directory, named after their SHA-1 digests. So if you have multiple attachments with the same data, the data’s only stored once.

Can I have multiple attachments with the same file name across different documents without having to make sure the file names are unique? For example, doc 1 as a file attachment named "picture.jpg" and document 2 has a different picture named “picture.jpg"

Yes, no problem. The filename is just part of the metadata associated with the attachment in the document. CBL doesn’t really care what it is.

—Jens
Reply all
Reply to author
Forward
0 new messages