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: Jean-Philippe Barrette-LaPierre <jean-philippe.barrette-lapierre_at_savoirfairelinux.com>
Date: Fri, 17 Jun 2005 08:17:18 -0400

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)

-- 
Jean-Philippe Barrette-LaPierre
Savoir-Faire Linux
_______________________________________________
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