|
-
Jan 16th, 2006, 02:04 AM
#1
Thread Starter
Fanatic Member
URLDownloadToFile not working.
Here's my code.
VB Code:
Private Sub cmdUpdate_Click()
Dim GoodOrBad As Long
Dim URL As String
Dim EndPath As String
URL = UpdateLink & "data.ssl"
EndPath = App.Path & "data2.ssl"
lblVersion.Caption = "Downloading File..."
GoodOrBad = URLDownloadToFile(0, URL, EndPath, 0, 0)
If GoodOrBad = 0 Then
lblVersion.Caption = "Finished."
MsgBox "File Downloaded."
frmSpellSwap.LoadData
Else
MsgBox "There was a problem downloading the file."
lblVersion.Caption = "Version: " & Version
End If
End Sub
When I run this, the file doesn't actually download and GoodOrBad always equals zero. What am I doing wrong?
-
Jan 16th, 2006, 02:12 AM
#2
Re: URLDownloadToFile not working.
VB Code:
hey = URLDownloadToFile(0, ServerPath, App.Path & "\temp.vdf", 0, 0)
Is the format..
It should return 0 always, that measn it downloaded the file..You then need to open the file using the App.Path & "\temp.vdf" parameter.
Also, youre file wont download everytime, only the first. You need this reference:
VB Code:
Public Declare Function DeleteUrlCacheEntry Lib "wininet.dll" ( _
ByVal lpszUrlName As String _
) As Long
And call it before downloading.
-
Jan 16th, 2006, 02:26 AM
#3
Thread Starter
Fanatic Member
Re: URLDownloadToFile not working.
Thank you very much. I had no idea there was a cache.
-
Jan 16th, 2006, 02:28 AM
#4
Re: URLDownloadToFile not working.
Neither did I until last week, thank Joacim
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
|