cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Login and uploading in one session

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 31 Mar 2005 00:26:06 +0200 (CEST)

On Thu, 31 Mar 2005, Matti Leino wrote:

> So I have to grab those random values, which are generated when accessing
> the page and post those values. And of course, I have to do two posts in one
> session.
>
> Is this possible? I have tried to play with options given in man-page, with
> no luck. Or am I missing something very simple?

I think you're missing the fact that you don't need (or want) to do this with
one single command line.

Using your favourite scripting language, you first fetch the login page,
extract the hidden fields and then you POST the login form using that data...
Then you extract the info in the next page and continue.

Remember to read/store the cookies between the curl invokes.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2005-03-31