How to download a file with WinHTTP in C/C++?

Merely opening the ofstream in binary mode does not change the way that the << operators work – they will always perfform formatted output. You need to use the stream’s write() function, which does unformatted output.

Leave a Comment