cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Reading from a stream

From: Stephen Collyer <scollyer_at_netspinner.co.uk>
Date: Thu, 27 Mar 2008 15:39:26 +0000

Robert Bielik wrote:
> Stephen Collyer skrev:
>
>> Can't you do this by passing the open stream pointer as CURL_READDATA,
>> then using the pointer in the read callback ? I have done exactly
>> this with the easy_ interface and it works fine (in my case, however,
>> I passed a pointer to an open Qt QFile object).
>
> Yes I could. If I'd get that far that is... thing is that CURL tries to
> open the file in Curl_getFormData
> with fopen(...) which fails and then I don't even get any callbacks at
> all...
>
> How did you cope with curl_formadd in your case? Did you pass it your
> QFile object's filename?

Right. I think I misunderstood your original post - you are using
curl_formadd with CURL_FILECONTENT to upload a file, I guess ?
I haven't used curl_formadd for that, I'm afraid. Having looked at
the docs, I get the feeling that you're out of luck. I can't see
that you can pass an open file stream in this case.

-- 
Regards
Steve Collyer
Netspinner Ltd
Received on 2008-03-27