Better function to download file through http
Posted on 2004-09-17
I already had a function to download file from http server.
My question is, is this function (GetFile()) good enough or there are another functions that work better (in speed)?
If there are better function, I need it.
for information, my program will download about 1000 files (size: 5 kilobytes, each file)
bool CMyProject::GetFile(const char *url, const char *filename)
#define HTTPBUFLEN 512 // Size of HTTP Buffer...
CStdioFile *remotefile = mysession.OpenURL(url,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
CFile myfile(filename, CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);
while (numbytes = remotefile->Read(httpbuff, HTTPBUFLEN))