|
-
Oct 7th, 2000, 05:21 AM
#1
Thread Starter
Member
I tried both method and a big problem I had was that they always seemed to put everything I downloaded into the cach and use that cached file. When I changed the version of the file on the net for testing purpose, it always "sent" me the old one. Took me some time to realise that since I thought my code was buggy.
So anyone know how to prevent it from using the cache? I guess I could delete the files directly from the cache but that's a pain.
-
Oct 7th, 2000, 10:52 AM
#2
Did you get the URLDownloadToFile to work? Because it won't work for me.
And Inet, you can tell it where to download on your computer.
-
Oct 7th, 2000, 11:02 AM
#3
Frenzied Member
Matthew, doesn't it work for you? Wich OS? Wich IE? Which... ehrr....
this works for me:
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 Function DownloadFile(URL As String, _
LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
DownloadFile "http://vbaccelerator.com", "c:\test.txt"
End Sub
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 7th, 2000, 11:21 AM
#4
IE 5.5, Win98 SE
Maybe I'm doing something wrong.
Let me try it again....
Nope, now it won't even work, just freezes.
-
Oct 7th, 2000, 11:27 AM
#5
Frenzied Member
Strange man 
It's ok it freezes, it does for me (4 seconds or so), it may take longer depending on your connection speed, it freezes up because it's synchronous, so the app waits till it's finished, before painting the form...
Put the code under a command button and do:
Code:
Private Sub cmdConnect_Click()
MsgBox DownloadFile("http://vbaccelerator.com", "c:\test.txt")
'and just wait for the MsgBox to be displayed... wait lonnggggg if needed :)
End Sub
PS, turn on your ICQ 
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 7th, 2000, 12:08 PM
#6
Thread Starter
Member
I know I can tell it where to download :P
What I mean is that : If you download a 4mb file, it will put it on your HD. Then, if you replace the file on the internet, via FTP with another one and try to redownload, it while give you the first damned file you first downloaded and will "download" in 4 secs or so.
-
Oct 7th, 2000, 12:17 PM
#7
I did put it in a Command Button. It told me true the first time when I tried it (not now..2 days ago, I think). And now it won't even do anything, just freezes. Oh wait...it just came up True. Hey! What is up with that? It works. When I save it to the Desktop, it doesn't save. But if I save it to C:\, it works. That's weird.
Dark Rain, you could try using Winsock.
Re: PS: I am on ICQ, I usually am whenever I'm on, just invisible, most of the time.
Thanks Jop, it works .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|