' File Download
Sub DownloadFile
' Declare Download Variable
Public TransferJob As HttpJob
' Initialize Download
TransferJob.Initialize("", Me)
' Download Link
TransferJob.Download(DownloadfileURL)
' Display message in Log
Log("Download started...")
End Sub
' File Download Completed
Private Sub JobDone (TransferJob As HttpJob)
' Transfer Successful
If TransferJob.Success Then
' Save Downloaded File To Harddrive
Dim out As OutputStream = File.OpenOutput(DownloadFileDrive, SaveDownloadedFileAS, False)
File.Copy2(TransferJob.GetInputStream, out)
out.Close
' Display message in Log
Log("Download complete")
Else
' Display message in Log
Log("Error: " & TransferJob.ErrorMessage)
End If
' Close File Transfer
TransferJob.Release
End Sub