I 've written a program based on WinInet that download files. It parses URL, can download using modem or proxy, select local directory for files and so on. Please test it and say how it works.
Thanks to all,
Posted on 2002-08-28 05:54:18 by Mike
very nice ... clean code ... like it! :alright:

maybe for the next version you can add
handler for redirectors and file size check,

for example for "http://www.google.com"
it returns "Success, 18221159 bytes downloaded."
and the html returned is only 2379bytes :tongue:

keep up the good work,
Posted on 2002-08-28 06:21:30 by TBD
Thank you TBD!
You are right, there is some little error in algorithm and exept it I must change variable for file length: now I store file length in DWORD but there are a lot of files > 4.2 Mb (2^32-1). All changes you'll see some days later.
But I don't know what you call as redirector. Can you describe it with more details?
Posted on 2002-08-28 09:38:35 by Mike
Just want to point out that 2^32 is 4 Gigabytes and not 4 megabytes... I'm sure there are few files out there that are bigger than this...

Posted on 2002-08-28 09:51:59 by chorus
i think he meant
in bits , not bytes
Posted on 2002-08-28 21:15:12 by eko
Mike: i was thinking for something like this in html files:
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.google.com">
but for this you need to have a HTML parser. bad ideea :)

also i dont know why i cannot get any file by using this url

HTTP download 1.5 by Iczelion timeouts too :confused:
Posted on 2002-08-29 00:53:52 by TBD

bazik@antares temp $ wget [url]http://www.pocketgear.com/download.asp?product_id=631[/url]
--08:30:32-- [url]http://www.pocketgear.com:80/download.asp?product_id=631[/url]
=> `download.asp@product_id=631.1'
Connecting to [url]www.pocketgear.com:80...[/url] connected!
HTTP request sent, awaiting response... 200 OK
Length: 45,675 [application/x-msdownload]

0K -> .......... .......... .......... .......... .... [100%]

08:30:34 (22.30 KB/s) - `download.asp@product_id=631.1' saved [45675/45675]

The filename is a bit fscked up though :)
Notice the stupid mime-type used there....
Posted on 2002-08-29 01:33:13 by bazik
Thanks to all!
Sorry for Mb & Gb. I was not right. This edition better, there are no in it "Success, 18221159 bytes downloaded." Exept it there some other changes.
I understand TBD's idea and I'll try to include it later. As I understand I may browse downloaded HTML file for references such as http://www.anysite.com/secondpage.html or
http://www.anysite.com/pic/prettygirl.jpg etc., insert them into list and download it by request. It's very interesting idea, thank you TBD.

Posted on 2002-08-29 05:30:52 by Mike
I understand why you can't download file from http://www.pocketgear.com/download.asp?product_id=631
There was some logical error in algorithm. This version can download your file, you must only change file name during download.
I yet have been download your file. Try it!alright:

Posted on 2002-08-29 06:32:34 by Mike
working like a charm !!! :alright:
except now it doesnt autodetect the proxy as in 2.0 version :(

also check your private messages :)
Posted on 2002-08-29 06:38:29 by TBD
Hi, TBD!

In this version you can choice any mode for connecting
to Internet without problems. Program also save it.
For example, if you choice today Autodetect then
tomorrow program detects it automatically.

Posted on 2002-08-29 09:54:12 by Mike
excelent :alright:

do you plan to add something in the next version ?
or it is finished ? :)

<To Be Defined>
Posted on 2002-08-30 00:33:20 by TBD
Certainly continuation will be. But now it is necessary to write the same program for WinSocks instead of WinInet. There there are more opportunities in WinSocks.
Posted on 2002-08-30 10:30:41 by Mike
Hi Mike

Not bad! But if I close the main window all other download windows remained opened! And if I klick the close button nothing happens! The download doesn't stop, but it seems that no window message is processed. (no repainting, no activation of the window if I click in it. Maybe you could fix it.

:) Marwin
Posted on 2002-08-30 11:28:39 by Marwin
Thank you Marvin!
You are right! A'll correct this bug, It may take a day.
Posted on 2002-08-31 07:37:11 by Mike
This version of the program close all dialogs and threads before exit.

Posted on 2002-09-02 02:31:51 by Mike

DlgProc proc hWin:DWORD,uMsg:DWORD, wParam:DWORD, lParam:DWORD
LOCAL Buffer[128]:BYTE, hThread:DWORD

frankly, i never seen someone using LOCAL var in dlgproc to save thread handle like yours, Mike. actually i used to make it global var instead. i know its impossible because the thread is created dynamically.
but, i really dont understand how can it keep preserved while dlgproc is can be called several times?
is it the top of stack keep on same offset? would it be written or free up when exiting dlgproc? gosh, i really stupid and dont get how it done :(
would you tell me what wrong in my mind, Mike?

Posted on 2003-01-14 20:50:13 by dion
It seem a pretty slow for me, but may be depend on connection
Your icon very nice :)
Posted on 2003-01-14 21:11:05 by Halong
hi Halong, i would to ask that one too ; but i'm waiting someone told me out the LOCAL problem above :(
Posted on 2003-01-15 01:56:21 by dion
Local variables resides in the stack. I can't recommend you to open file and store it's header (e.g. hFile) there, but sometimes you can use LOCALs. You are right sometimes there a lot of problems with local variables.

Posted on 2003-01-15 06:53:20 by Mike