|
It is the following code, the saved picture cannot be displayed normally. Where is the problem?
===========================================
CInternetSession sess;
CHttpFile * pFile = (CHttpFile *) sess.OpenURL (pstrURL, 1, INTERNET_FLAG_TRANSFER_ASCII || INTERNET_FLAG_RELOAD, headers, strlen (headers));
char buffer [1024];
CStdioFile file;
file.Open ("C:\\aaa.jpg", CFile :: modeWrite | CFile :: modeCreate);
while (pFile-> Read (buffer, sizeof (buffer)))
{
file.Write (buffer, sizeof (buffer));
}
Ranch
file.Close ();
pFile-> Close ();
sess.Close (); |
|