cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problem Downloading files from webpage using cURL -- still struggling

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 26 May 2004 14:09:13 +0200 (CEST)

On Wed, 26 May 2004, Peter Caccamo wrote:

> Q1: The general question: what is the syntax for downloading a file from a
> webpage, using cURL, and having to use HTTPS protocol ?? any other software
> requirement in addition to cURL ??

Did you try reading any docs? I believe this is pretty clearly stated:

        curl [URL]

But then you'll get the downloaded data sent to the terminal, so using -o or
-O is very common as well.

> Q2: I am trying to download file mbs052004.zip from webpage
> https://198.204.142.102/PDD/ having to use HTTPS protocol

That will give you a problem with the server certificate that can't be
verified (since the host name doesn't match the name in the certificate). You
can avoid that error by using --insecure.

> Here's the command-line command that I executed ( is this correct syntax ??
> ) curl https://198.204.142.102/PDD/mbs052004.zip

1. You need to ignore that you can't verify the certificate: --insecure

2. Redirect the downloaded file: -O

3. The previous page (https://198.204.142.102/PDD) sets cookies, you probably
   need to store them in a first access and then request the actual file in
   a second request using the previously stored cookies.

 I tried this, but failed too. You need to investigate what your browser does
and how to mimic that with curl. I recommend adding LiveHTTPHeaders and
ethereal to your tool belt for this.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-05-26