cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_INFILESIZE and padded files

From: Jason Pump <jpump_at_mindspring.com>
Date: Wed, 17 Jan 2007 13:25:54 -0800

On Tue, 16 Jan 2007, Peter Seebach wrote:

An alternative path, which seems to be working but probably shouldn't, is to
simply open ANOTHER file with fmemopen pointing at the same buffer, but
specify the precise size of the jpeg. This works, but curl still reports
error code 18, even though the uploaded file is precisely the same size as
the encoded jpeg data, and appears to be correct.

I think this should work, and should not return 18. Maybe there's an
off-by-one error somewhere?

Dan Fandrich wrote:
> On Wed, Jan 17, 2007 at 06:23:55AM -0600, Peter Seebach wrote:
>
>> The read callback has to be able to, from the "stream" pointer, figure
>> out where it is in the buffer, and it needs to somehow find out from the
>> rest of my code what the size limit is. So, either I make the stream
>>
>
> You can use ftell(3) to tell where you are from the stream itself. Finding
> the maximum is a bit trickier.
>
Received on 2007-01-17