READDATA in CURL contrib lib

175 views
Skip to first unread message

Com1 Software

unread,
Jun 24, 2012, 2:37:15 PM6/24/12
to harbou...@googlegroups.com
I have been working with the CURL contrib lib to try and create an SMTP example.

I have my email working perfect using CURL in a command line mode so I know the
file I am sending is good and I have all my other user setting the way I need them.

When I try to port things to using the library I am having a problem determining how to specify the
file I wish to send since I see READDATA is not supported/specified in the hburl.ch file.

I have tried several other options for the input file like the HB_CURLOPT_FILE and HB_CURLOPT_INFILE with no
success. Any suggestions.

Thanks
Dave

Claudia Neumann

unread,
Jun 24, 2012, 3:06:27 PM6/24/12
to harbou...@googlegroups.com, Com1 Software
Hi Dave,

did you look at and test contrib/hbcurl/tests/ftp.uIdl.prg?

Best regards

Claudia

Com1 Software

unread,
Jun 24, 2012, 4:28:42 PM6/24/12
to harbou...@googlegroups.com, Com1 Software

Hi Claudia,

Yes, that has been the base of my testing and it seems to work fine with the
uploading and downloading. In the example there is HB_CURLOPT_UPLOAD and a few others that I have tried as well with no success.

In reading about CURL and the READDATA it looks like it is used to set the file that is send as the email http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTREADDATA

Here is a link to an example in the command line mode that is useful
http://curl.haxx.se/mail/archive-2010-10/0030.html
The -T is used to set the file.

Like so many things in programming my guess is that we have another way to pass a file name other than READDATA.

Thanks
Dave

Claudia Neumann

unread,
Jun 24, 2012, 5:06:46 PM6/24/12
to harbou...@googlegroups.com, Com1 Software
Hi Dave,

You have to set several HB_CURLOPT:

curl_easy_setopt( curl, HB_CURLOPT_UL_FILE_SETUP, cUL )
curl_easy_setopt( curl, HB_CURLOPT_INFILESIZE, hb_FSize( cUL ) ),
hb_FSize( cUL )

the cUL is the filename.

Perhaps you post the code that is not functioning.
Reply all
Reply to author
Forward
0 new messages