cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multipart form trouble

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 8 Sep 2009 10:12:39 +0200 (CEST)

On Mon, 7 Sep 2009, Oliver Maylen wrote:

You're asking about the curl tool so the curl-users would be more suitable
list to discuss this on.

> I am trying to implement the use of curl in a script I am writing which
> involved uploading a file in a multipart form. Here is the command I am
> using as I expected it to be from reading the tutorials:
>
> First we have to log into the site:
>
> curl -H 'User-agent: Mozilla/5.0' -H 'Content-Type:
> application/x-www-form-urlencoded'

That header implies that it isn't a multipart formpost.

> -b cookies www.my-site.org -c cookies www.my-site.org

-b and -c are not used like that.

> -F file=/path/to/filename.zip

Note that this doesn't upload the given file, it just sets the variable 'file'
to be the file name.

To sum up: you want -d not -F.

-- 
  / daniel.haxx.se
Received on 2009-09-08