Question

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: 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

Was it helpful?

Solution

OK This was solved. I realized that gftp was uploading the files with wrong encoding in the name. It was using UTF8

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top