You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ralf Nieuwenhuijsen <ra...@gmail.com> on 2008/04/15 01:13:25 UTC

Posting an attachment directly

Hi, i'm tempting to go an all javascript route interfacing with couchdb.
(i'm using qooxdoo)

But two potentional aspects worry me:

1. Will it be supported in the future to post an attachment directly?
This would make it possible ot use the browser to directly upload a file to
the couchdb server

POST /somedatabase/somedoc/_attachment HTTP/1.0    <== adds a new attachment

2. Will it be possible to use allow a post alternative for put & delete
operations?
This would enable crossdomain usage using an iframe backend ;-)

POST /somedatabase/_bulk_docs   HTTP/1.0         <== put alternative
already exists!
POST /somedatabase/_bulk_delete HTTP/1.0         <== delete
alternative doesn't exist yet!

PS. Do we delete attachment by just removing them from the document?

Greetings,
Ralf


 -

This was a browser can be used to post attachments directly to the couchdb
server.

Re: Posting an attachment directly

Posted by Oliver Oli <ol...@gmail.com>.
I also would like to see direct binary attachement upload as an
alternative to the base64 encoded attachements. why waste cpu cycles?

On Tue, Apr 15, 2008 at 1:13 AM, Ralf Nieuwenhuijsen
<ra...@gmail.com> wrote:
> Hi, i'm tempting to go an all javascript route interfacing with couchdb.
>  (i'm using qooxdoo)
>
>  But two potentional aspects worry me:
>
>  1. Will it be supported in the future to post an attachment directly?
>  This would make it possible ot use the browser to directly upload a file to
>  the couchdb server
>
>  POST /somedatabase/somedoc/_attachment HTTP/1.0    <== adds a new attachment
>
>  2. Will it be possible to use allow a post alternative for put & delete
>  operations?
>  This would enable crossdomain usage using an iframe backend ;-)
>
>  POST /somedatabase/_bulk_docs   HTTP/1.0         <== put alternative
>  already exists!
>  POST /somedatabase/_bulk_delete HTTP/1.0         <== delete
>  alternative doesn't exist yet!
>
>  PS. Do we delete attachment by just removing them from the document?
>
>  Greetings,
>  Ralf
>
>
>   -
>
>  This was a browser can be used to post attachments directly to the couchdb
>  server.
>

Re: Posting an attachment directly

Posted by Jan Lehnardt <ja...@apache.org>.
On Apr 15, 2008, at 01:13, Ralf Nieuwenhuijsen wrote:
> Hi, i'm tempting to go an all javascript route interfacing with  
> couchdb.
> (i'm using qooxdoo)
>
> But two potentional aspects worry me:
>
> 1. Will it be supported in the future to post an attachment directly?
> This would make it possible ot use the browser to directly upload a  
> file to
> the couchdb server
>
> POST /somedatabase/somedoc/_attachment HTTP/1.0    <== adds a new  
> attachment

I've seen support for form handling in the MochiWeb code and this  
looks very interesting to me, so we might get that at some point. But  
it is not priority.


> 2. Will it be possible to use allow a post alternative for put &  
> delete
> operations?
> This would enable crossdomain usage using an iframe backend ;-)
>
> POST /somedatabase/_bulk_docs   HTTP/1.0         <== put alternative
> already exists!
> POST /somedatabase/_bulk_delete HTTP/1.0         <== delete
> alternative doesn't exist yet!

Maybe, Patches are welcome :) What you can do already is setting the  
_deleted flag in your _bulk_docs JSON for the docs that need to be  
deleted and have them removed en-bulk.


> PS. Do we delete attachment by just removing them from the document?

Yup.

Cheers
Jan
--