'Download Code
Sub FTP_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"
Log(s)
'END
End Sub
'Download Code
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then Log(LastException.Message)
FTP.DeleteFile(strSerialnumber)
'END
End Sub
'Download Button
Sub Download_Click
Dim DateDMY As String
DateDMY = DateTime.GetDayOfMonth (DateTime.now) & "-" & DateTime.GetMonth (DateTime.now) & "-" & DateTime.GetYear (DateTime.now)
Dim DateDMYUMS As String
DateDMYUMS = DateTime.GetDayOfMonth (DateTime.now) & "-" & DateTime.GetMonth (DateTime.now) & "-" & DateTime.GetYear (DateTime.now) & "_" & DateTime.GetHour (DateTime.now) & "u" & DateTime.GetMinute (DateTime.now) & "m" & DateTime.GetSecond (DateTime.now) & "s"
Dim strSerialnumber As String
strSerialnumber = GetDeviceId
strSerialnumber = strSerialnumber & ".db"
Dim strDatumDownload As String
strDatumDownload = "mapftp/" & DateDMYUMS
strDatumDownload = strDatumDownload
'Uncomment this to find out the serial number stored on DirRootExternal
'FTP.DownloadFile("IGO.db", True, File.DirRootExternal, strSerialnumber)
FTP.DownloadFile(strSerialnumber , True, File.DirRootExternal, strDatumDownload)
End Sub