Hi.
I've looked for a lot and found some solutions. But I don't know where i'm missing...
I need to take a photo using camera and send the captured image using ftp... B4A ok, it's worked fine... but doesn't work in B4I.
The code that i'm using is:
B4X:
Sub camera1_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
If Success Then
If Image.IsInitialized Then
Dim p As Phone
Dim out As OutputStream = File.OpenOutput(File.DirDocuments,"test2.png",True)
Image.WriteToStream(out, 100, "PNG")
p.AddImageToAlbum(Image)
out.Close
Dim FTP As FTP
FTP.Initialize("FTP", "fpt.server.test", 21, "user", "pwd")
FTP.UploadFile(File.DirDocuments,"test2.png",False,"/gx5.PNG")
End If
End If
Hi...
I've tried to do this here. This returns with success (file was uploaded successfully).... but when I will confirm it on ftp, the file isn't there....
Credentials are exactly the same then I used on B4A...
The code now is:
B4X:
Dim out As OutputStream = File.OpenOutput(File.DirDocuments,"test2.png",True)
Image.WriteToStream(out, 100, "PNG")
p.AddImageToAlbum(Image)
out.Close
Dim FTP As FTP
FTP.Initialize("FTP", "ftp.server", 21, "user", "pwd")
Dim sf As Object = FTP.UploadFile(File.DirDocuments,"test2.png",False,"/test2.png")
Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Log("file was uploaded successfully")
Else
Log("Error uploading file")
End If