cURL / Mailing Lists / curl-library / Single Mail

curl-library

Downloading files using HTTP

From: Michael Stather <michaelstather_at_nuzi.de>
Date: Mon, 6 Oct 2003 18:31:28 +0200

Hi,

Iīve a (wxWindows) program which downloads data using cURL as following:

curl_easy_setopt(ms_CurlHandle,CURLOPT_FAILONERROR,1);
curl_easy_setopt(ms_CurlHandle,CURLOPT_NOPROGRESS,1);
curl_easy_setopt(ms_CurlHandle,CURLOPT_WRITEDATA,l_File.fp());
curl_easy_setopt(ms_CurlHandle,CURLOPT_URL,m_URL.c_str());
curl_easy_setopt(ms_CurlHandle,CURLOPT_ERRORBUFFER,m_ErrorBuffer);
if (curl_easy_perform(ms_CurlHandle) != CURLE_OK)
...

L_File.fp returns a FILE* to a file opened for writing
mURL.c_str() returns a const char *

This part works fine for html pages, they are downloaded so that I can
process them.
The problem is when downloading a binary file, in my example a .DLL
The file I get has the same size but different contents that the one which I
uploaded server, and of course it doesnīt work when loaded.
What can be the reason for this.
I thought of switching to FTP, but HTTP is just simpler, and downloading
binary files with HTTP is possible, isnīt it?

So, what am I doing wrong here?

Thanks in advance

Michael Stather

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-10-06