incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Whorn <thewh...@googlemail.com>
Subject Re: Uploading attachments using Multipart/related
Date Tue, 25 Mar 2014 17:59:03 GMT
you may want to read the src of the nodejs modules nano/request - search for "multipart"

> Am 25.03.2014 um 15:37 schrieb JC de Villa <jc.devilla@gmail.com>:
> 
> This is absolutely driving me nuts.
> 
> I'm sure it's easy. Uploading multiple attachments just don't seem to want
> to work for me.
> 
> Argh!
> 
> 
> 
> 
>> On Tue, Mar 25, 2014 at 6:31 PM, JC de Villa <jc.devilla@gmail.com> wrote:
>> 
>> Thanks Nick, much appreciated.
>> 
>> 
>>> On Tue, Mar 25, 2014 at 6:20 PM, Nick North <north.n@gmail.com> wrote:
>>> 
>>> Sounds as if that should work then. I'm not much of a curl user, so don't
>>> know if there are any other potential problems in the command line. I'm
>>> not
>>> around my CouchDb installations today, but I can construct a working
>>> request this evening if no-one else beats me to it.
>>> 
>>> Nick
>>> 
>>> 
>>>> On 25 March 2014 09:56, JC de Villa <jc.devilla@gmail.com> wrote:
>>>> 
>>>> I had the same thought in that it might be the parser complaining about
>>>> formatting, and I've made sure that it matches the example exactly.
>>>> 
>>>> 
>>>>> On Tue, Mar 25, 2014 at 5:52 PM, Nick North <north.n@gmail.com>
wrote:
>>>>> 
>>>>> Do you have the same initial line breaks as in the example? I can't
>>>>> remember the exact details at the moment, but mime parsing can be
>>>> sensitive
>>>>> about that and, if you are missing the line break before the first
>>>> boundary
>>>>> string, it might skip over the JSON body.
>>>>> 
>>>>> Nick
>>>>> 
>>>>> 
>>>>>> On 25 March 2014 09:25, JC de Villa <jc.devilla@gmail.com>
wrote:
>>>>>> 
>>>>>> Hmm,
>>>>>> 
>>>>>> I get the same using -T and --data-binary (tried again just now).
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Tue, Mar 25, 2014 at 5:22 PM, Alexander Shorin <kxepal@gmail.com
>>>> 
>>>>>> wrote:
>>>>>> 
>>>>>>> On Tue, Mar 25, 2014 at 1:19 PM, JC de Villa <
>>> jc.devilla@gmail.com>
>>>>>> wrote:
>>>>>>>> curl -X PUT -H 'Content-Type: multipart/related;
>>> boundary="abc123"'
>>>>>>>> http://localhost:5984/odms_contents/abc -d@test.data
>>>>>>> 
>>>>>>> That's the problem. -d sends data as text. you should use
>>>>>>> --data-binary or -T argument to send it as binary.
>>>>>>> 
>>>>>>> --
>>>>>>> ,,,^..^,,,
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> JC de Villa
>>>> 
>>>> 
>>>> 
>>>> --
>>>> JC de Villa
>> 
>> 
>> 
>> --
>> JC de Villa
> 
> 
> 
> -- 
> JC de Villa

Mime
View raw message