元の zip ファイルは 4KB です。サーバーに ftp 経由でアップロードすると、サイズが小さくなり、つまり 3.032KB になりました。zip ファイルが破損していて、開くことができないようです。なぜそれが起こるのですか?どのように修正できますか?
ftpコード
public static void uploadFilesToServer(String filename){
File file = new File(filename);
FTPClient client = new FTPClient();
FileInputStream fis = null;
try {
client.connect("ftpsrv2.koln.de");
client.login("user", "pass");
client.setFileType(FTP.BINARY_FILE_TYPE);
fis = new FileInputStream(filename);
if(client.storeFile(file.getName(), fis)){
System.out.println("Upload success");
}else{
System.out.println("Upload faild");
}
client.logout();
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}