cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

Re: [cURLpp] Downloaded binary files are corrupted

From: Nazario Cipriani <NazarioCipriani_at_web.de>
Date: Fri, 17 Jun 2005 14:34:43 +0200

Jean-Philippe Barrette-LaPierre wrote:
> On June 17, 2005 08:05 am, Jean-Philippe Barrette-LaPierre wrote:
>
>>On June 17, 2005 06:27 am, you wrote:
>>
>>>Hi All!
>>>
>>>The problem with binary files seems won't stop.
>
>
> <snip>
>
>>>>>I've tried downloading a zip file from host with its original size of
>>>>>5kB. After revceiving it with the class posted above I write the buffer
>>>>>to disk with
>>>>>
>>>>> // Get the result...
>>>>> char* Result = this->m_pConnection->GetResult();
>>>>>
>>>>> // Prepare the parameters for parsing...
>>>>> std::stringbuf* Buffer = new std::stringbuf(Result);
>>>>> std::istream* StringBuffer = new std::istream(Buffer);
>
>
> I repeat: You should not use stringbuf is it's a binary file! It uses
> std::basic_string.size() to get the size of the buffer! (Which look for a
> ending zero)
>

OK.
Thank you for the hint...

The code is quite long and sparsed over many files...
Perhaps I can get the relevant parts separated and paste it later here.

But what should I use instead?
I need an std::istream to process the downloaded files.
The istream constructor looks like this:
        explicit istream (streambuf * sb);

And I don't know other ones. I'm pretty new to this issue...
Perhaps you have an idea?

Thanks...
Regards, Nazario.

-- 
Spanne den Bogen, aber schieße nicht los!
Noch gefürchtet zu sein ist wirksamer!
(altes chinesisches Sprichwort)
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2005-06-17

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET