Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.3k views
in Java FTP by (160 points)
Hi,

The file i am uploading using the FTPClient class is having having German Characters in its file name and hence the class throws out the following exception.

com.enterprisedt.net.ftp.FTPException: /Upload/{60D5949C-8158-4234-9B29-9D263104379B}/Dokument mit ?.txt: Error on output file.
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:872)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:1358)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:1328)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:1313)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:1291)
at com.altair.TestFTPClient.UpLoad(TestFTPClient.java:75)
at com.altair.TestFTPClient.main(TestFTPClient.java:29)


The file i am uploading is this E:\\Upload\\{60D5949C-8158-4234-9B29-9D263104379B}\\Dokument mit

3 Answers

0 votes
by (162k points)
Take a look at setControlEncoding
0 votes
by (160 points)
What Encoding do you set?

I set UTF-16. It gives me another exception during connect

com.enterprisedt.net.ftp.FTPException: ?????????????????
at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:872)
at com.enterprisedt.net.ftp.FTPControlSocket.validateConnection(FTPControlSocket.java:302)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:279)
at com.enterprisedt.net.ftp.FTPControlSocket.<init>(FTPControlSocket.java:252)
at com.enterprisedt.net.ftp.FTPClient.connect(FTPClient.java:620)
at com.altair.TestFTPClient.UpLoad(TestFTPClient.java:68)
at com.altair.TestFTPClient.main(TestFTPClient.java:29)

This is my code :

if(m_ftpClient==null)
{
m_ftpClient = new FTPClient();
m_ftpClient.setRemoteHost(url.getHost());
m_ftpClient.setControlEncoding("UTF-16");
m_ftpClient.connect();
m_ftpClient.login(user, password);
m_ftpClient.setConnectMode(FTPConnectMode.PASV);
m_ftpClient.setType(FTPTransferType.BINARY);

}//
0 votes
by (162k points)
Try Latin-1

Categories

...