curl-library
Re: File type to download
Date: Mon, 22 Jun 2009 22:43:23 -0500
Since you seem to have refused/ignored my request for
some *complete* source code, I will post what works
for me:
'===============================
#include once "curl.bi"
open "TESTFILE.BIN" for binary access write as #1
private function write_callback cdecl ( byval buffer as byte ptr, _
byval size as integer, byval nitems as integer, _
byval outstream as any Ptr) as Integer
Dim as integer bytes = size * nitems
put #1 ,,*buffer,bytes
function = bytes
end function
dim url as string = _
"http://softlayer.dl.sourceforge.net/sourceforge/fbc/FB-manual-0.20.0-chm.zip"
dim as CURL ptr curl_handle
curl_handle=curl_easy_init
curl_easy_setopt( curl_handle, CURLOPT_VERBOSE,1)
curl_easy_setopt( curl_handle, CURLOPT_URL, url )
curl_easy_setopt( curl_handle, CURLOPT_WRITEFUNCTION, @write_callback )
dim retval as integer
retval=curl_easy_perform(curl_handle)
print "curl_easy_perform() returns: ", retval
curl_easy_cleanup(curl_handle)
'===============================
The program above works perfectly here (on Linux/x86).
So maybe your problem is indeed something system-specific, as Guenter mentioned.
- Jeff
Received on 2009-06-23