I'm able to download text documents (.html, .txt, etc) but I can't download images or exe's. I'm pretty sure that this is because I'm using a char, and those files are binary. I know that in C# I would use a byte. But what data-type would I use in this case?
char buffer[1];
DWORD dwRead;
FILE * pFile;
pFile = fopen(file,"w");
while (InternetReadFile(hRequest, buffer, 1, &dwRead))
{
if(dwRead != 1) break;
fprintf(pFile,"%s",buffer);
}
fclose(pFile);