I shall be happy if somobody could answer at:

Why API InternetSetFilePointer which permits to choose the position of pointer in a file on internet is not more quick than read from the beginning (by using InternetReadFile)...if someone understand and know the response please send me it...



My E-mail is: GChapillon@aol.com if somebody has the response....
Posted on 2002-11-01 03:22:53 by gerard
just some things:
- you should use InternetOpen with INTERNET_OPEN_TYPE_PRECONFIG flag for those who use proxies to access
the internet or have an option to set the proxy
- for size you should use HttpQueryInfo with HTTP_QUERY_CONTENT_LENGTH flag and if the size is 0 it does not
mean only that the file is not found, it also means that the server does not report length in HTTP header

this is what i spotted at one quick glance, hope it helps somehow.

you should take a look at http://www.asmcommunity.net/board/index.php?topic=7596 for another
downloader made in assembler.

good luck and welcome to win32asmcommunity board

ps. i send you an email with this info too.
Posted on 2002-11-01 04:07:53 by TBD
Yeah....I found how to do to resume a download with the API of Wininet.dll..

.data
GetTemplate db "Range: bytes=%lu-",0Dh,0Ah
db "User-Agent: WhatYouWant",0Dh,0Ah
db "Connection: Close",0Dh,0Ah
db "Accept:text/*,image/*,application/*,*/*",0Dh,0Ah,0dh,0ah,0
.data?
rert dd ?

.....
.....
.....
invoke wsprintf,ADDR Header,ADDR GetTemplate,pub_BytesReceived
invoke InternetCloseHandle,hSsession
invoke InternetOpenUrl,hINetSession,ADDR Buffer,ADDR Header,-1,INTERNET_FLAG_RELOAD,1
mov hSsession,eax
mov pdwBufferLength,0
invoke HttpQueryInfo,hSsession,HTTP_QUERY_FLAG_NUMBER or HTTP_QUERY_CONTENT_LENGTH ,NULL,addr pdwBufferLength,lpPointer
invoke HttpQueryInfo,hSsession,HTTP_QUERY_FLAG_NUMBER or HTTP_QUERY_CONTENT_LENGTH,addr rert,addr pdwBufferLength,0
mov eax,nSize
......

you ought now to see if rert is or not equal to nSize(Size of File)...
and after use InternetSetFilePointer then InternetReadFile....and so forth...


I think that I perfectly well-explained this...

It is very symilar to the use of API of winsock.dll

NOW AFTER THAT , I REFORMULATE AN OTHER QUESTION ....IT IS ALWAYS THE SAME BUT NOW BY USING FTP AND NOT HTTP....


If somebody finds, please send me or answer in that forum, I think it is better....


GChapillon@aol.com


If you want to see this second version go to:

http://pageperso.aol.fr/GerardChap/DAP1.zip
Posted on 2002-11-05 08:40:48 by gerard
It is about resuming a file with in a FTP site...

You ought to use API FtpCommand (wininet) and code rfc959....

Warning: FtpCommand and FtpGetFileSize are not in vininet.inc....

In that fact you have to load them and build a function....

....
after FtpCommand you have to use InternetGetLastResponseInfo....

In my case I only used "Default instruction rfc959"...and in that fact, certain sites are not "resuming", like one says.....

Thank you very much for your reading...

GChapillon@aol.com

If you want a good prog....goto..

http://pageperso.aol.fr/GerardChap/DAPVersion3.zip

PS: If someone of you have some questions to ask me, or some comments to do, please e-mail me...I shall be happy to give you some clues.....
Posted on 2002-11-12 05:48:28 by gerard
If some of you want to have some clues for API of Wininet.dll

I can give them a good URL at the bottom of this message....

You will be able to program a downloader of files from a Http Site....


I have not done a tutorial for FTP, perhaps a lack of time, but I think it will be easy for you ton find alone....





http://pageperso.aol.fr/GerardChap/Annexe.zip
Posted on 2002-11-23 10:39:44 by gerard