Hi Robert.

Very poor description by me early this morning. Sorry.

The problem is the upload file size and type:

> Content-Length: 4
> Content-Type: application/x-www-form-urlencoded

Should be :

 "content_type": "image/jpeg",
      "length": 66518,

It indicates success but it isn't.

Content length is only 4 and type is application/x-www-form-urlencoded

I cannot get a reason for this.

Thanks for the input.



On 12 January 2017 at 15:02, Robert Samuel Newson <[email protected]>
wrote:

> That looks like a successful upload. What problem are you reporting here?
>
> > On 12 Jan 2017, at 03:17, John Le Brasseur <[email protected]>
> wrote:
> >
> > Hi.
> > While trying to upload an attachment using curl I get the following:
> >
> > curl -vX PUT
> > http://user:[email protected]:5984/albums/6e1295ed6c29495e54cc05947f18c8
> af/img.jpg?rev=32-f32a6d93b0f9483c4580adb5e0075fe4
> > --data-binary @img.jpg -H "Content-Type: image/jpeg"
> >
> > * STATE: INIT => CONNECT handle 0x600091250; line 1402 (connection
> #-5000)
> > * Added connection 0. The cache now contains 1 members
> > *   Trying 127.0.0.1...
> > * STATE: CONNECT => WAITCONNECT handle 0x600091250; line 1455 (connection
> > #0)
> > * Connected to 127.0.0.1 (127.0.0.1) port 5984 (#0)
> > * STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600091250; line 1562
> > (connection #0)
> > * STATE: SENDPROTOCONNECT => DO handle 0x600091250; line 1580 (connection
> > #0)
> > * Server auth using Basic with user 'jlb333333'
> >> PUT
> > /albums/6e1295ed6c29495e54cc05947f18c8af/img.jpg?rev=32-
> f32a6d93b0f9483c4580adb5e0075fe4
> > HTTP/1.1
> >> Host: 127.0.0.1:5984
> >> Authorization: Basic amxiMzMzMzMzOk50WmwuNkR3
> >> User-Agent: curl/7.49.0
> >> Accept: */*
> >> Content-Length: 4
> >> Content-Type: application/x-www-form-urlencoded
> >>
> > * upload completely sent off: 4 out of 4 bytes
> > * STATE: DO => DO_DONE handle 0x600091250; line 1659 (connection #0)
> > * STATE: DO_DONE => WAITPERFORM handle 0x600091250; line 1786 (connection
> > #0)
> > * STATE: WAITPERFORM => PERFORM handle 0x600091250; line 1796 (connection
> > #0)
> > * HTTP 1.1 or later with persistent connection, pipelining supported
> > < HTTP/1.1 201 Created
> > < Cache-Control: must-revalidate
> > < Content-Length: 96
> > < Content-Type: application/json
> > < Date: Thu, 12 Jan 2017 02:29:25 GMT
> > < Location:
> > http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/img.jpg
> > * Server CouchDB/2.0.0 (Erlang OTP/17) is not blacklisted
> > < Server: CouchDB/2.0.0 (Erlang OTP/17)
> > < X-Couch-Request-ID: 7d9cc02465
> > < X-CouchDB-Body-Time: 0
> > <
> > {"ok":true,"id":"6e1295ed6c29495e54cc05947f18c8af","rev":"33-
> 47753389b1d0b6d6427a4c018a4d0604"}
> > * STATE: PERFORM => DONE handle 0x600091250; line 1955 (connection #0)
> > * multi_done
> > * Connection #0 to host 127.0.0.1 left intact
> > * Expire cleared
> >
> >
> > The actual file size is 66518 bytes.
> >
> >
> > If I upload the same file using fauxton, it uploads correctly.
> > ("IMG.jpg": {
> >      "content_type": "image/jpeg",
> >      "revpos": 24,
> >      "digest": "md5-jlDEFsvG0rz0KJMMaWIfSQ==",
> >      "length": 66518,
> >      "stub": true)
> >
> > I have tried different spelling(Content-Type: image/jpg) and putting
> > in/removing quotation marks around http.... eg 'http... and "http...
> >
> >
> > John Le Brasseur
>
>


John

Reply via email to