cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cannot upload file via http

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 19 Jan 2004 00:18:27 +0100 (CET)

On Fri, 16 Jan 2004, Chris Snider wrote:

> --- FORM report. Uses POST to URL "/cehttp/servlet/MailboxServlet"

> Here is my curl command using the -d option going directly to the
> MailboxServlet script

This doesn't seem to be a multipart formpost, and then -d is correct. I'm a
bit puzzled though since the form includes a file upload which I was under the
impression that you always use multipart formposts for...

> curl -b /tmp/cookietest2 -L -d operation=UPLOAD -d data_format=A -d
> mailbox_id=BOBSMITH -d batch_id=TEST_FILE -d put_flag=ignore -d
> sourcefile=/home/bsmith/TEST_FILE

This last option will not upload the file, only pass on the path.

> Here is my curl command using the -F option going directly to the user form
>
> curl -b /tmp/cookietest2 -L -F operation=UPLOAD -F data_format=A -F
> mailbox_id=BOBSMITH -F batch_id=TEST_FILE -F put_flag=ignore -F
> sourcefile=@/home/bsmith/TEST_FILE -F Submit=Submit
> https://www.testsite.com/cehttp/html/upload.htm

This is using the wrong URL. You should use the /cehttp/servlet/MailboxServlet
one.

> It generates this error
>
> curl: (56) Received problem in the chunky parser

That looks like a curl bug.

> curl 7.9.8 (i686-pc-linux-gnu) libcurl 7.9.8 (OpenSSL 0.9.6b) (ipv6 enabled)
> on RedHat Linux 8 kernel 2.4.20

That's a pretty old version. I would recommend upgrading to something newer
and better.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-19