My original zip file is 4KB. When i upload it via ftp on server, the size is smaller namely 3.032KB.it seems to me zip file is corrupted and can't be open. Why it happens? how can be fixed?
ftp code
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();
}
}