I want to download a file from a URL with the wininet apis. First i open an handle with:

call InternetOpen pascal,0,0,0,0,0

Then i open an URL with:

call InternetOpenUrl pascal,0,0,0,0,offset url,

Then i want to know how big is the file which i want to download:

call InternetQueryDataAvailable pascal,0,0,offset filesize,

And here come the problem: The Returned fileszize is wrong. F.e. , an index.html with the size 18.2kb has the filesize 3,5kb. Has anybody an idea what am i doing wrong with InternetQueryDataAvailable?
Posted on 2003-04-24 13:12:43 by belial
i found out the solution. You simply have to use call HttpQueryInfo() with HTTP_QUERY_CONTENT_LENGTH for looking how much data is available.
Posted on 2003-04-24 16:51:58 by belial