hi:
I am a software engineer from China and I have just downloaded the latest version :edtFTPj-2.0.4.
It seems that the method uploadFile(localFileName, remoteFileName) in class FileTransferClient does not work if the parameter "remoteFileName" contains Simplified Chinese Characters,such as uploadFile("C:/demo.wmv", "哈哈.wmv").
Before invoking the uploadFile method I have invoked method getAdvancedSettings().setControlEncoding("GBK2312") as the API says.
Here below are my codes:
FileTransferClient ftp = new FileTransferClient();
try{
ftp.setRemoteHost("192.168.1.101");
ftp.setUserName("admin");
ftp.setPassword("admin");
ftp.connect();
ftp.getAdvancedSettings().setControlEncoding("GBK2312");
String localPath = "F:/";
String localFileName = "Kings.without.crown.by.magiconeal.wmv";
ftp.setContentType(FTPTransferType.BINARY);
System.out.println("上传开始时间:"+ new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.ssssss").format(new Date()));
System.out.println("文件大小:"+new File(localPath+localFileName).length()/(1024*1024)+"MB");
ftp.uploadFile(localPath+localFileName, "中文演示.wmv");
System.out.println("上传结束时间:"+ new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.ssssss").format(new Date()));
and the stack trace are below:
enterprisedt.net.ftp.FTPException: 550 /????.wmv: Cannot create file.
at enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:1128)
at enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2518)
at enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2577)
at enterprisedt.net.ftp.FTPClient.putStream(FTPClient.java:2310)
at enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2195)
at enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2281)
at enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:669)
at enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:643)
at demo.Edtftpj_FTPTransferClient.main(Edtftpj_FTPTransferClient.java:27)
By the way,I have just made anothoer demo using class FTPClient, it works fine with Simplified Chinese after I invoke FTPClient.setControlEncoding("GBK2312").
Thanks a lot !