What are the pros and cons of using HTTPUtils vs FTP to download files from the web server?
for i=0 to 10
FTP.DownloadFile("/somefolder/files/" & filename(i), False, File.DirRootExternal, filename(i))
next
Sub Service_Create
FTP.Initialize("file_transfers", "ftp://www.myserver.com", 21, "user", "password")
End Sub
sub download_file_click
FTP.DownloadFile("/tablet/database/wine_tablet.db", False, File.DirRootExternal, "wine_tablet.db")
end sub
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 Sub
Sub FTP_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success=True Then
File.Copy("File.DirRootExternal","wine_tablet.db","File.DirDefaultExternal","wine_tablet.db")
End If
End Sub
Made the changes and still nothing. I notice in the tutorial that in the initialization line, the format of the server name is "ftp.servername.com", rather than "ftp://www.servername.com" -- also, is 21 the correct port or might that need to be changed?
FTP.PassiveMode =True