Re: how do I download files using the Inet control?
Originally posted by dekelc hello,
I just need to transfer a list of files from the internet to a folder.
how do I do that using the Inet control? is there a better way of
doing that?
thanks
The Inet control is a very good tool for that exact task... Is it just a list you need? You could do; myFile = Inet1.OpenUrl("www.google.com/myfile.txt")
Please notice that the path is invalid, unless google has something like that laying around(which I do doubt, hehe)
- change it to the path of your own file
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
what do you mean by 10MB???
thats a lot for a program that just download stuff from the
internet... is there another way of doing that?
and by the way, how do I know in to which folder the Inet is
downloading?
Originally posted by dekelc what do you mean by 10MB???
thats a lot for a program that just download stuff from the
internet... is there another way of doing that?
and by the way, how do I know in to which folder the Inet is
downloading?
You could use winsock, or Api - but that'd make it a whole lot harder...
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Yup. When I just compiled it, it was 24Kb, but wouldn't run on my dad's computer. I used P&D, and zipped the output. The zip file is 9,145Kb. I had trouble emailing it to a friend to test, I had to use my dsl email address. I wasn't about to sit at dad's waiting for 10MB to download at 56K, so I burned it onto a CD.
I solved my other problem by just installing it in the folder that I wanted.
The program downloads an updated database for a program that his club uses for their golfing handicap system. I had to go over there every week to help dad get things into the right folder.
Now, I have to teach him how to click the program on the start menu when he knows that there is a fresh copy avaiable. I just got him to be able to run the db program off the start menu without going online to do it! Now, I can coach him from the house if he gets lost.
All-in-all, a win-win situation. May even offer it to the rest of the group...
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
I just used the P & D Wizard to create an install of the code I posted here (to download files from the net) http://www.vbforums.com/showthread.p...hreadid=301827
and the entire package came out at 1.48mb. I can't figure out why dglienna's package is ~10mb
OK, OK, so I haven't tested it on any other PCs yet. I'll do that when I've got some time and get back to you:
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
I agree, something is wrong on your side Dglienna... A control that big would loose it's value since the same thing can be achieved with a few lines of API code...
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
and then follow the instructions and install the tlbs on your PC. This is used for the callback stuff so the downloadurl api can update the prog bar.
The is VERY good code for downloading a file from a web site.
Also, you have to remember that windows caches interweb downloads, so the 2nd time you test it it will be VERY VERY quick.
So you have to manually delete the cached file from the folder.
this may be one reason that increased ur setup's size.
If u r using or even have reffered ADO in ur application then Package & Deployment wizard will include MDAC_TYP.EXE file into setup. MDAC_TYP.EXE version 2.5's filesize is 7.50 MB and which is already compressed. Remaining 2.5 MB may includes vb runtimes, inet ocx and application's exe.
well, MDAC is there, but I don't know why.
I just have a form that downloads the file and exits.
Nothing else. I think that it included it so that it'll work with W98, but I don't know why.
Any ideas?
Originally posted by dglienna well, MDAC is there, but I don't know why.
I just have a form that downloads the file and exits.
Nothing else. I think that it included it so that it'll work with W98, but I don't know why.
Any ideas?
Remove it - there's absolutely no reason for it being there!
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
he meant for me to remove MDAC from my project. nobody using it has Win98 (as far as I know) may give it away to fellow golfers... will have it both ways. glad i can make it 75% smaller!
Originally posted by Deepak Sakpal this may be one reason that increased ur setup's size.
If u r using or even have reffered ADO in ur application then Package & Deployment wizard will include MDAC_TYP.EXE file into setup.
I don't think it does.
You have to manually add this file to the setup.
If you install ADO by running the setup file, and then delete the file from your PC (since it isn't needed anymore), then how can it be added in?
Even if it's not deleted how does the P&D Wizard know where this setup file is?
What it does add is an msado tlb file, for which it says dependacies cannot be found, and it asks you if you want to add that file to the project.
I believe that you should add this file, but instead add the ado setup exe file.
I remember that I clicked on an ICON thinking it was the INET control. Went to the upper left corner of Form1, and wouldn't really delete. Must have been what caused MDAC. Have to drop my code into a new project to get rid of it.
Originally posted by Wokawidget I don't think it does.
You have to manually add this file to the setup.
If you install ADO by running the setup file, and then delete the file from your PC (since it isn't needed anymore), then how can it be added in?
Even if it's not deleted how does the P&D Wizard know where this setup file is?
What it does add is an msado tlb file, for which it says dependacies cannot be found, and it asks you if you want to add that file to the project.
I believe that you should add this file, but instead add the ado setup exe file.
Woof
Woka
Package & Deployment wizard includes MDAC_TYP.EXE automatically in setup, you don't have to include it yourself. See the attached file.
Well, I've tested this 3 times on 3 different PCs.
And all it tried to add is the ado tlb file.
Are you 100% sure that the file wasn't added in manually?
Think about this logically. How can it be added in automatically when the pc doesn't know where it is. No values it reg to point to it's location etc.
Originally posted by Wokawidget Well, I've tried this on 4 machines now.
Not one added it in automatically.
I disagree with this. It works for me.
Ok, let me tell u what steps i followed:
1 - I created a new vb project and generated a form from Data Form wizard which added reference to Microsoft ActiveX Data Objects 2.0 Library
2 - I compiled my project and created exe.
3 - Selected Package & Deployment Wizard from Microsoft Visual Studio 6.0 Tools menu.
4 - Selected my .vbp file from browse button
5 - Clicked 'Package' button and clicked next button two times and that screen (which i posted in my last post) appeared with MDAC_TYP.EXE file included in Files list automatically.
I'm attempting a similar thing to the topic creator, and
Deepak Sakpal's code worked nicely. My question is: how would i go about performing this operation backwards; ie, uploading from a local file to the web?
I'm making an rankings program for a game; i want it to be able to download the scores file, let the user change their scores and settings etc, and then replace the online file with the updated file.
Any help, or suggestions on alternative methods of achieving this?
For the sake of the argument, yes i can...but i don't know how.
I can see this is going to be quite the complicated.
what if i were to store the data in a publicly writeable folder?
Errr...publicly wriable folder...errrr...then there would be no need for a single line of VB code.
If you wanted to "upload" a file to a server...and you don't have a drive mapped to it, then u must have some sort of app running on the server that you can connect to and then send the file to.
This can be an EXE using winsock, or a web server with web pages.