Download attachment

18 views
Skip to first unread message

Todd Freese

unread,
Oct 29, 2015, 7:51:26 PM10/29/15
to Couchbase Mobile
We have a web client that get's it's data from sync gateway. Displaying jogs that are stored as attachments works great.

However, I need to have a download button that actually downloads the attachment to disk. Are there any header that I can set to force a request for an attachment to download?

All my attachments are JPGs.

Todd

Jens Alfke

unread,
Oct 30, 2015, 1:26:58 PM10/30/15
to mobile-c...@googlegroups.com

On Oct 29, 2015, at 4:51 PM, Todd Freese <to...@filmworkers.com> wrote:

However, I need to have a download button that actually downloads the attachment to disk. Are there any header that I can set to force a request for an attachment to download?

I believe the HTTP Content-Disposition response header is used to tell a browser to download a resource to disk instead of displaying it. Check the HTTP 1.1 spec.

You could use a proxy like nginx or Apache to add such a header to the appropriate responses.

—Jens

Todd Freese

unread,
Oct 30, 2015, 2:02:49 PM10/30/15
to Couchbase Mobile
Worked like a champ setting the Content-Disposition header.

Thanks!

T
Reply all
Reply to author
Forward
0 new messages