B4J Question [SOLVED]FTP Upload problem

PatrikCavina

Active Member
Licensed 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?
 

DonManfred

Expert
Licensed User
Longtime User
sounds like the destination system (or the ftp-server itself is configured to use 8+3 filenames) only supports 8+3 filenames!?
 
Upvote 0

PatrikCavina

Active Member
Licensed 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