Android Question FTP Upload logs "Upload OK" but the file received is bad

DOM85

Active Member
Licensed User
Longtime User
Hello,

As i have a problem with FTP Upload, i created this small example to show it easily. It is quite the example given by Erel :

Sub Process_Globals
Dim FTP As FTP
End Sub

Sub Globals
Dim sf As Object = FTP.UploadFile(File.DirRootExternal, LocalDirectory" & "photo.jpg", True, RemoteDirectory & "photo.jpg")
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
FTP.Initialize("FTP", serveur, 21, username, password)
End If

Wait For (sf) FTP_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
Msgbox ("Upload OK","")
Else
Msgbox ("Upload error","")
End If

ExitApplication
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub

The program displays "Upload OK", but the result is bad. The picture transmitted is bad, however not considered as corrupted by any player ir picture editor. Only a small part of the beginning of the picture is ok.
If anyone knows this problem, thank you great for your help.

DOM
Windows 10 Pro - B4A 8.50 - Library Net 2001-2011 (i don't know where is the V1.70)
 

DOM85

Active Member
Licensed User
Longtime User
1 - Thank you for the advice for showing my code. I did not know.

2 - You are right about my interpretation of the example by Erel.
In the line "Dim sf as Object..." the term "False" instead of "True" was the solution !

Thank you for having put me on the good path !

Kind regards.
DOM.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…