How to retrieve attachment via SG view query.

15 views
Skip to first unread message

Todd Freese

unread,
Jun 30, 2015, 3:52:08 PM6/30/15
to mobile-c...@googlegroups.com
How can I retrieve an attachment, a jpg, using a SG view query?

With couchDB, you can get a URL to the attached image which makes it easy to display on a web page.

Todd

Jens Alfke

unread,
Jun 30, 2015, 4:04:59 PM6/30/15
to mobile-c...@googlegroups.com

> On Jun 30, 2015, at 12:52 PM, Todd Freese <to...@filmworkers.com> wrote:
>
> How can I retrieve an attachment, a jpg, using a SG view query?
> With couchDB, you can get a URL to the attached image which makes it easy to display on a web page.

Just like CouchDB — via the Sync Gateway REST API, GET /dbname/docid/attachmentname

—Jens

Todd Freese

unread,
Jun 30, 2015, 4:07:49 PM6/30/15
to mobile-c...@googlegroups.com
Never mind, I found the answer. 

My file names needed to be percent encoded for the REST call.

Todd
Reply all
Reply to author
Forward
0 new messages