FTPClient - Java, upload file

后端 未结 8 963
遇见更好的自我
遇见更好的自我 2020-12-08 19:58

I\'m trying to do a VERY simple file upload. I want a Java FTPClient that can upload any file I tell it to. But the pdf always gets all messed up and my pdf editor (Adobe) w

8条回答
  •  旧时难觅i
    2020-12-08 20:49

    Try to use BufferedInputStream, this is a (working) code sample:

    BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f));
    res = client.storeFile("File Name", bis);
    bis.close();
    client.logout();
    

提交回复
热议问题