Sub btnDownload_Click
lbldownloadprogress.Visible = True
lbldownloadprogress.Text = "Attempting to contact server..."
DoEvents
dlftp.Initialize("FTPdownload", "ftp.mydomain.com", 21, "user", "pw")
lbldownloadprogress.Text = "Attempting to download..."
DoEvents
dlftp.DownloadFile("test.txt", False, File.DirRootExternal, "test.txt")
End Sub
Sub FTPdownload_DownloadProgress (ServerPath As String, TotalDownloaded As Long, Total As Long)
Dim s As String
s = "Downloaded " & Round(TotalDownloaded / 1000) & "KB"
If Total > 0 Then s = s & " out of " & Round(Total / 1000) & "KB"
lbldownloadprogress.Text = s
End Sub
Sub FTPdownload_DownloadCompleted (ServerPath As String, Success As Boolean)
lbldownloadprogress.Visible = False
If Success = False Then
Msgbox("Download failed. Contact support.","Download Error")
Else
End If
dlftp.Close
End Sub