cURL / Mailing Lists / curl-users / Single Mail


Re: Post File to HTTPS via cURL at command line

From: Ralph Mitchell <>
Date: Tue, 14 Jun 2005 18:45:01 -0500

Here's some stuff to get you started:

On 6/14/05, Amy Petri <> wrote:
> POST /template/login HTTP/1.1
> Cookie: FDX=
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 48
> user=username&password=password&switch=Log+In

The above couple of lines are the form data being posted back, and the
Cookie line tells you that you'll probably need to track cookies, so
at the minimum this first block reduces to something like this:

curl -b cookies -c cookies -d

You can ignore the icons:
> GET /icons/logo.gif HTTP/1.1
> GET /icons/dir.gif HTTP/1.1
> GET /favicon.ico HTTP/1.1

> GET /incoming/?T HTTP/1.1

Follow on with:

curl -b cookies -c cookies ""

> POST /incoming HTTP/1.1
> Content-Length: 194
> Content-Disposition: form-data; name="File"; filename="test.txt"
> Content-Type: text/plain

And finally:

curl -b cookies -c cookies -F File=@test.txt

though Ive never done a file upload, so that may be a little shaky... :)

That may not be the whole story, but it should get you nearer to where
you need to be.

Ralph Mitchell
Received on 2005-06-15