// JP opened flex table

Click to See Complete Forum and Search --> : File Download


AltPluzF4
January 16th, 2008, 08:23 PM
Hello, I'm using URLDownloadToFile, and it seems to be leaving files fragmented.
For example, if I download a 3mb mp3, it's in about 45 fragments.

Can someone please suggestion a better method for downloading files, that won't leave the fragmented?
Thanks.

Igor Vartanov
January 17th, 2008, 06:49 AM
InternetOpenUrl
HttpQueryInfo with HTTP_QUERY_STATUS_CODE
if (200)
HttpQueryInfo with HTTP_QUERY_CONTENT_LENGTH
while( InternetReadFile )
{
. . . put data to disk
}
InternetCloseHandle

AltPluzF4
January 17th, 2008, 10:44 AM
Thanks, that plus SetFilePointer seems to have fixed the problem.

One more question, what's the best "buffer" size to use? Currently I just have it running on a 50kb buffer, but I'd like to optimize.

Igor Vartanov
January 18th, 2008, 04:11 AM
Who knows. Do experiment :)

AltPluzF4
January 18th, 2008, 04:19 AM
I have, seems to make no difference if I have it at 1kb - 500kb...
Oh well downloads at max speed, so thanks again.

//JP added flex table