Downloading files from URL
Hey guys,
I decided the other day that i wanted to create a simple program that downloads files based on the users specifications. Now what i'm wondering is, what is the most simplest code you can think of that would allow me to download these files? Is this possible to create without having a million or so declarations or any API's?
thanks for your help guys.
Re: Downloading files from URL
The Inet control allows you to download files. I use it in a couple of my apps.
1 Attachment(s)
Re: Downloading files from URL
Before long time ago i found this...
Re: Downloading files from URL
there is a very simple API urldownloadfile
vb Code:
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
Private Declare Function DeleteUrlCacheEntry Lib "wininet.dll" _
Alias "DeleteUrlCacheEntryA" _
(ByVal lpszUrlName As String) As Long
call it like
vb Code:
'ensure this file does not exist in the cache
Call DeleteUrlCacheEntry(sSourceUrl)
If DownloadFile(sSourceUrl, sLocalFile) Then
'code for successful download
Re: Downloading files from URL
Re: Downloading files from URL
Sorry guys, i didn't explain it properly. What i'm after is code that can do the same things such as those picture downloaders you can find on the net (Eg, type in a url and all the images/videos/what ever are downloaded from that site)
It doesn't have to be advanced, just the basics will be the way to go. Ultimately i just want a program that can download files from the internet.
So if i went to a random site and i typed in *.html, then all it would download would be the html page.
Thanks for all the help.
Re: Downloading files from URL
Check out my previous post. It shows the user how much of the file has downloaded using a progressbar.
Re: Downloading files from URL
Thanks for that lintz, i'm don't have vb infront of me atm but, will that allow me to do what i want from my last post?
Thanks again
Re: Downloading files from URL
Re: Downloading files from URL
Lol, u didn't answer my question.
Will that allow me to do what i asked in response #6?
Thanks
Re: Downloading files from URL
is it possible to download a file to a variable declare in VBA instead of a file in a drive?