Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
If Success Then
If Image.IsInitialized Then
Dim folder As String = File.DirDocuments
Dim filename As String = "myFile.jpg"
saveAndUploadFile(Image,folder,filename)
End If
End If
End Sub
Sub saveAndUploadFile(bmp As Bitmap,folder As String, fileName As String)
'first we need to save the file
Dim Out As OutputStream
Out = File.OpenOutput(folder,fileName, False)
bmp.WriteToStream(Out, 100, "JPEG")
Out.Close
'now we can upload it
sftp1.UploadFile(folder, fileName, "/File name")
Wait For sftp1_UploadCompleted (Success As Boolean)
'...
End Sub