cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multipart posting (the hard way)

From: Kjetil Jacobsen <kjetilja_at_cs.uit.no>
Date: 26 Feb 2002 11:55:41 +0100

On Tue, 2002-02-26 at 06:57, Daniel Stenberg wrote:
> On Mon, 25 Feb 2002, Clarence Gardner wrote:
>
> > Then I need to do a multipart upload. I have the entire multipart message
> > body in a string, and I've added the multipart header. The server gets the
> > header, but content-length is always zero, and the body is not sent.
> >
> > opt(pycurl.POST, 1)
> > opt(pycurl.POSTFIELDS, f.read())
> > opt(pycurl.URL, 'https://login.postini.com/exec/Admin?action=change_batch')
> > opt(pycurl.HTTPHEADER, [MPHeader])
>
> Does this pass the entire string to the POSTFIELDS input? (My Python skills
> are a bit limited.)
>
> Note that you might need to use CURLOPT_POSTFIELDSIZE too to set the size of
> the entire POST, if you want to prevent libcurl from using strlen() to figure
> it out by itself. It is very odd that you get content-length 0.
>
> If you pass the full string and the correct size, it should work.
>
> What libcurl version is this?

i've fixed a bug in pycurl which may have caused the content-length to
become zero in the example above.

test and install the following version of pycurl and see if it helps:

        http://pycurl.sourceforge.net/pycurl-0.4.7-pre1.tar.gz

regards,
        - kjetil
Received on 2002-02-26