Important alert: (current site time 7/16/2013 3:33:50 AM EDT)
 

winzip icon

Internet File Control (File Properties and Download, with Resume Function) UPDATED!

Email
Submitted on: 8/4/2000 3:58:28 PM
By: Dirk Hottes 
Level: Advanced
User Rating: By 23 Users
Compatibility: VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 28813
 
     This control download a given Url to a local file. You can stop the download process on any time and resume it later. With this control you can also get information, like filesize, last modification date and if the file exists, about an given url. This control doesn't use any ActiveX control. Code is completly written with WinInet Api.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

8/4/2000 4:01:27 PMDirk Hottes

If you like this little snippet, please vote for it. I just want to know, if i'm going to build more of such samples the next time or not.
(If this comment was disrespectful, please report it.)

 
8/4/2000 4:05:32 PMAustin

looks promising. is there a way to automatically capture downloads started with IE, and send them to a VB program like this one? I have seen this done by other shareware programs in different languages. One was called GoZilla...

-Austin
(If this comment was disrespectful, please report it.)

 
8/4/2000 5:31:45 PMMatt

Good code but one question. Where does it save the file to?
(If this comment was disrespectful, please report it.)

 
8/5/2000 4:38:22 AMDirk Hottes

You can set the Filename, where the control will save the file, by setting the localfile property.
(If this comment was disrespectful, please report it.)

 
8/5/2000 6:48:57 AMbeppe

It is good. It would be better if it would have the possibility to POST value pairs to web pages.

Actually it does not take to much time to add it to it (but it is a little bit tricky)
(If this comment was disrespectful, please report it.)

 
8/5/2000 7:01:42 AMDirk Hottes

What would you like to post exactly? Can you give me an example, so I can figure out how it works and update this control for the PSC-Community. Maybe it is possible to build a perfect ActiveX Control for the internet with some guys here on PSC. If someone is interested in developing such a component with me, please leave a message, or mail me.
(If this comment was disrespectful, please report it.)

 
8/5/2000 9:07:45 AMChristian

I think we should avoid activex controls as much as we can, cuz it takes up space in your installation.

It is posible to make this or anything else work like Godzilla and Getright, but it will requiere some advanced hwnd programming.

It dosnt seem like the PROXY function is fully supported. It didnt work for me. If there is some detailed informations about useing PROXY servers please email me.

Chris
(If this comment was disrespectful, please report it.)

 
8/5/2000 1:01:19 PMDirk Hottes

It seems to be, that everyone wants to write a program, like Gozilla or GetRight ;-). I have written such a application a year ago, so I think I will finish this project and post it here on PSC.

Christian: Please check your Proxy settings, if the proxy settings are ok and it still doesn't work, please leave a message about your system configuration, so I can check it here on my network. I'm using a Sambar-Server and it works fine for me.


(If this comment was disrespectful, please report it.)

 
8/7/2000 3:54:11 AMThomas Miller

This was, what I needed. I give you an EXCELLENT. Keep Coding.
(If this comment was disrespectful, please report it.)

 
8/8/2000 9:09:02 AMmatrox

I have having trouble with the resume part. i try to download something from a site that does not give the file size, and when i try to resume it starts over again. does this mean that the site does not support download resuming?
(If this comment was disrespectful, please report it.)

 
8/8/2000 9:16:55 AMmatrox

i checked the site i was trying to download from and gozilla says that it supports download resuming. Got any ideas?
(If this comment was disrespectful, please report it.)

 
8/9/2000 1:24:41 AMThomas Miller

@matrox: I've tested the Resume Part on many different maschines and it seems to be ok. Be sure not to delete the file before resuming, because the control automatically set the filepointer to the filesize of the localfilename. Everytime you resume the download the Url and the localfilename has to be the same. I'm currently developing a control wich supports much more features and more stable, so keep your eyes open and watch for 'InternetFile Control'.
(If this comment was disrespectful, please report it.)

 
8/9/2000 2:43:03 AMThomas Miller

Ok, Dirk Hottes and I, have built a new control, wich is simpler to use, as this one. You can now choose a Connectiontype. Preconfig --> Internet Explorer Settings, Proxy --> Given Proxy, Direct --> Direct Connection. We have also fixed some bugs, with the proxy support. Dirk will upload the file when he is back from work. This must be 8am or 9am in the States.
(If this comment was disrespectful, please report it.)

 
8/9/2000 10:14:59 PMmatrox

did he upload it??
(If this comment was disrespectful, please report it.)

 
8/10/2000 9:26:43 AMDirk Hottes

OK I've uploaded the new Version of the control. Please tell me or Thomas, if something is missing, or does not work. By the way, Thanks Thomas
(If this comment was disrespectful, please report it.)

 
8/10/2000 2:16:39 PMmatrox

i have figured out why i could not get the file size. i was trying to download from a ftp url. when you use this to download from a ftp url it does not report the file size and the resume can be kinda unstable, like not working sometimes. just thought i would let you know about it.
(If this comment was disrespectful, please report it.)

 
8/11/2000 3:30:23 AMDirk Hottes

Thanks matrox, i will send you an email, when Thomas and I have realized the ftp stuff. Thanks for your comments, if you have any troubles you can send me an email. ;-)
(If this comment was disrespectful, please report it.)

 
8/13/2000 5:00:06 AMEric Malamisura

This is pretty good code. It seems everyone follows a trend on the coding trail =] Has more functionality than my source code did and is very well done. I give you congrats on this. Keep up the good work guys. I struggled through the winsock thing long enough til I got fed up with it hehe. Excellent Rating from me =]

(If this comment was disrespectful, please report it.)

 
9/27/2000 1:50:04 AMAnDy2552

Good code. I gave excellent for this. However, the proxy thing is a bit buggy especially if the proxy has cached infor in it.
Maybe you need to be able to specify how many bytes to rollback.

(If this comment was disrespectful, please report it.)

 
9/27/2000 11:40:58 AMCarlos Escobar

seems to be missing clsFileDownload.cls file

???
(If this comment was disrespectful, please report it.)

 
9/29/2000 9:40:15 AMPlinio

Excellent code, it's a really must have
from PSC.

Good work D.

(If this comment was disrespectful, please report it.)

 
10/1/2000 12:30:52 AMBenjo Bartolome

Very nice!

Expecially if you can integrate it with the default browser so when he clicks a link to a ZIP file for example, it launches this program automatically.
(If this comment was disrespectful, please report it.)

 
2/12/2001 9:38:35 PMDennis Willett

I downloaded this code but something seems to be missing. When I try to open downloadacivx.vbp it is looking for clsDOWNLOAD.cls but the file is not zipped in the package. Am I missing something here?

Dennis (WILLETTD1@JUNO.COM)
(If this comment was disrespectful, please report it.)

 
6/16/2001 1:06:26 PMMAGiC MANiAC^mTo

Hi, I think this code is compleet when I also can upload files to FTP-hosts, because then I can write my own code with the help of using this good code.

I'm a webmaster and I want to download files in a schedular to upload it automatic on my site this helps me to update my site and always be up to date, I know that I can use ftp applications, but I like to have my own code to change things (for example) in a page before I upload the page to my site...

(the current download code is really stable, it downloads everything I want to download)...

This Code Rulez!...
Thanks for the code!...

MAGiC MANiAC^mTo
mto@kabelfoon.nl

http://www.welcome.to/mto
http://downloadtools. startkabel.nl
http://java.startkabel.nl

(If this comment was disrespectful, please report it.)

 
1/23/2002 2:23:20 PMmario

can i use your code as basic for a freeware download-agent from me?
i made new features to it...
thanks for feedback
(If this comment was disrespectful, please report it.)

 
4/15/2002 10:39:02 AMCobwebs

The cobwebs are forming now, a couple years lat8r down the track since its original posting of this code...

Very good, except it still contains bugs, which I would never be able to fix myself, I hate winsock coding.

The proxy/direct connection does not work, if you download a file, then delete the test.bin file it creates, then download it again, it seems to have a "cached" version of it and does not download the file??? Is this winsock doing this or is this an error in the proxy/direct connection interface?

Also, the fileexist function doesn't work, not sure why, but I enter a filename that should return a 404 Not found page, and the function still returns true for fileexists.

Nice code otherwise, I'd help fix these bugs, but Im a winsock klux klan.
(If this comment was disrespectful, please report it.)

 
5/22/2002 7:14:56 PMJustinTheCodeMonkey

I Have been programming in many lang. for more then 10 years and have to say that this is an awsome program. Thanks!
(If this comment was disrespectful, please report it.)

 
10/7/2002 10:16:37 PM

Good program!! but
missing clsFileDownload.cls !!!!
hope u will include this file soon!
i suggest when u make the prog from other directory just copy it all the project *.bas, *.frm *.cls in one directory..

(If this comment was disrespectful, please report it.)

 
12/14/2002 4:07:01 AMSerpooshan

thanks for your submission, share it for all
(If this comment was disrespectful, please report it.)

 
4/8/2003 12:51:07 PM

Very good code! But the "Download ActiveX" project is missing the clsFileDownload.cls. Any plans to update this submission?
(If this comment was disrespectful, please report it.)

 
1/7/2004 9:14:19 PMpampatipraveen

Its good.
But I treid to download some files. But it download exact bytes but when writtend to file it is more than actual file size

what would be the problem
(If this comment was disrespectful, please report it.)

 
7/14/2004 1:12:40 AM

This is a very intersting sample.
Do we know how to optain the class clsFileDownload to test your code.


(If this comment was disrespectful, please report it.)

 
7/26/2004 3:08:43 PMMladen

Hi, I dont know if this message will get to you, but I will take the
chance.

Your code is excellent
(http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=10403&lngWId=1) .

There is only one problem, it seems to keep all the data in some sort
of cache. For example, a pass protected file called file.zip is to be
downloaded with some username and password. If I donwnload it (with
correct user and pass) and delete the file, then change the username or
password to be incorrect it still reports like it downloaded it, and it
does, but in a split second. And the file really appears like downloaded.
So I am guessing it is cached somewhere.
This problem also happens with username and password. For example, if I
run the app and try to download the file with a wrong pass, then change
it to a correct path, it still keeps using the wrong one.

I would apreciate you help.

Thanks, and again, Great code!

Regards,
Mladen

(If this comment was disrespectful, please report it.)

 
5/16/2005 8:38:40 AMBrant Wells

Excellent piece of work, man! I'm using it in my apps now! Keep up the awesome work... I'd give you 5 stars if we could still vote!
(If this comment was disrespectful, please report it.)

 
7/19/2006 6:28:04 AMAndy Sleeuwaert

EXCELLENT! This is what i was searching for a long time by now. Thanks alot!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.