-1

我的原始 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();
    }
}
4

1 回答 1

3

一切都很好,4kb 是您磁盘的最小块大小。看看这个

于 2012-03-20T15:15:35.910 回答