cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Newbie Question on https File Transfer

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 17 Nov 2003 17:55:20 +0100 (CET)

On Mon, 17 Nov 2003, Linsley, Terry wrote:

> I attempting to automate an https file transfer using command line
> cURL. The problem I have is encountered is that the site's login page has a
> content type that requires me to us cURL's "-d" option to post the login
> information. This part I can do successfully, but when I "navigate" to the
> upload page it has a content type requiring cURL's "-F" option to fill in
> the form and include the data file to be uploaded.

> If I try to do this in two invocations of cURL, them on the second I
> get an error saying "not logged in".

The second invokation probably needs some kind of data from the first invoke
that prove to the server that you're still logged in and belonging to that
"session". This is usually made with the use of cookies (check for Set-Cookie:
in the received headers). Try storing them with -c in the first command line
and read them again with -b in the second.

> If I try doing it all on one invocation, cURL tells me I can only do one
> http request (but maybe my syntax is bad).

No, curl only supports one kind of POST in a single command line.

> I even tried doing two invocations with the first saving its session-id
> cookie to a file and the second reading the cookie. No love there.

Then try setting the referer field properly in the second request, and check
the headers carefully from the first request to see what is really going on.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
 [[ Do not post private mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
Received on 2003-11-17