B4J Question [SOLVED]FTP Upload problem

PatrikCavina

Active Member
Licensed User
Longtime User
Hi to all,
I'm trying to transfer file via FTP.
When i use UploadFile method, file is transfered on FTP Server with a strange name.
Example:
Original File Name: "Nuovo documento di testo.txt" -> On FTP Server: "_CPCE6~8.TXT"

Original File Name: "Nuovo Foglio di lavoro di Microsoft Excel (2).xlsx" -> On FTP Server: "_VMR7H~K"

I've already tried to set control encoding
B4X:
Public Sub Connect(Host As String, Port As Int, User As String, Password As String)
    ftp.Initialize("FTP", Host, Port, User, Password)
    Dim r As Reflector
    r.Target = ftp
    Dim ftpJO As JavaObject = r.GetField("client")
    ftpJO.RunMethod("setControlEncoding", Array("UTF8"))
End Sub

But result was the same.
Any suggest?
 

PatrikCavina

Active Member
Licensed User
Longtime User
My error was to use File.Combine(DestinationFTP, FileName) in ServerFilePath parameter of FTP.UploadFile.
Because file.combine() return path with "\" and not with "/".
 
Last edited:
Upvote 0
Top