I have a working application that downloads a specific file in the Ftp Server.
I have the filename I want to download, so I was just connecting and using:
http://ftp.retrieveFile(filename, fileInputStream);
So now we had to change the ftp server, and this new one ftp server I think runs under linux (the old one was windows). Now I can´t download files with name that contains ISO-8859-1 strings, like ç ã á ó õ.
I tryed to use ftpClient.setControlEncoding(“ISO-8859-1”) just after the constructor of the FTPClient but it didn´t work. when retrevieFile is called it returns false because it fails to find the file. But it is working fine with filenames without those strings.
I am reading the filename from another file…
I made a mistake once, that I read, the filename as ISO_8859-1 (but it was encoded as UTF-8 in the file) and then tryed to retrevieFile and it worked with strange characters in the name.
What is happening??
EDIT:
This are answers from the server:
SYST
215 UNIX Type: L8
FEAT
211-Features:
EPRT
EPSV
MDTM
PASV
REST STREAM
SIZE
TVFS
211 End
OK This was solved.
I realized that gftp was uploading the files with wrong encoding in the name. It was using UTF8