Hi all, i have this code:
Work fine the first time, after if i select new file, the event FTP_UploadCompleted ISNT fired
Any idea ?
Thank you
Marco
B4X:
Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
If Success Then
filenameresize = "foto" & DateTime.Now
Log(filenameresize)
'******Save picture and trasfert via FTP
Dim Out As OutputStream
Out = File.OpenOutput(File.DirTemp, filenameresize & ".jpeg", False)
Image.WriteToStream(Out, 100, "JPEG")
Out.Close
img_photo.Bitmap = LoadBitmap(File.DirTemp,filenameresize & ".jpeg")
'ftp was previously initialized And its event name was set To ftp:
ftp.Initialize("FTP", "ftp.xxxx.eu", 21, usr_ftp, pw_ftp)
ftp.PassiveMode = True
ftp.UploadFile(File.DirTemp, filenameresize & ".jpeg", False, "/" & filenameresize&".jpeg")
Else
Log("Non selezionato")
End If
End Sub
Sub FTP_UploadCompleted (ServerPath As String, Success As Boolean)
Log(ServerPath & ", Success=" & Success)
If Success = False Then
Log(LastException.Message)
Else
Toast.ShowToastMessage("Foto copiata sul server ",2000)
End If
End Sub
Work fine the first time, after if i select new file, the event FTP_UploadCompleted ISNT fired
Any idea ?
Thank you
Marco