Private Sub TileDownload(Fname As String) As ResumableSub
Dim res As Boolean
Dim dir As String
Dim p As Int
p=Fname.LastIndexOf("/") ' Fname enters as complete Path address. FileName just the last part
dir=Starter.rp.GetSafeDirDefaultExternal(WorkDirectory)
Dim sf As Object = ftp.DownloadFile(Fname, True,dir , Fname.SubString(p+1))
res=False
Wait For (sf) ftp_DownloadCompleted (ServerPath As String, Success As Boolean)
Sleep(100)
If Success Then
'Log(Fname & " was downloaded successfully")
res=True
Else
'Log("Error downloading file")
End If
Return res
End Sub