Starter.storage.DownloadFile("/public/Untitled.png", File.DirInternal, "1.txt")
Dim stop() As Boolean = Array As Boolean(False)
MonitorDownload(stop)
Wait For Storage_DownloadCompleted (ServerPath As String, Success As Boolean)
stop(0) = True
If Success Then
Log("download successfully")
End If
Sub MonitorDownload(stop() As Boolean)
Dim Start As Long = DateTime.now
Dim Timeout As Long = 10 * DateTime.TicksPerSecond
Do While stop(0) = False And Start + Timeout > DateTime.Now
Sleep(200)
Loop
If stop(0) = False Then
Log("Timeout")
CallSubDelayed3(Me, "Storage_DownloadCompleted", "", False)
End If
End Sub