cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Encoding issue getting an image with libcURL

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 8 Feb 2005 14:53:20 -0800

On Tue, Feb 08, 2005 at 12:26:19PM -1000, julien.woillez_at_free.fr wrote:
> I am trying to get an image and write it to a file. It apparently works since I
> do receive an image, however the content of the image is completely wrong. When
> I compare the image I get with my code and the original, I notice some
> discrepencies. It seems to be relate to the wen carriage returns are encoded. I
> compile the following code on windows platfrom with VC++ 7.1.
[...]
> destFile = fopen("myImage.gif,"w");

You need to open the file in binary mode, so Windows won't corrupt your
end-of-line bytes. Change this line to:

          destFile = fopen("myImage.gif,"wb");

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2005-02-09

These mail archives are generated by hypermail.

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

File upload with ASP.NET