Sub Process_Globals
Dim FTP As FTP
Dim currentFileSize As Int
End Sub
Sub Globals
Dim pb As ProgressBar
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
FTP.Initialize("FTP", "xxx.xxx.xxx.xxx", 21, "username", "password")
End If
pb.Initialize("")
Activity.AddView(pb, 0, 0, 100%x, 30dip)
currentFileSize = File.Size(File.DirRootExternal, "1.mp4")
FTP.UploadFile(File.DirRootExternal, "1.mp4", False, "/1.mp4")
End Sub
Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then pb.Progress = 100
End Sub
Sub FTP_UploadProgress (ServerPath As String, TotalUploaded As Long, Total As Long)
Log(TotalUploaded & " " & Total)
pb.Progress = 100 * TotalUploaded / currentFileSize
End Sub