나는 무언가를 알아 내기 힘든 시간을 보내고 있습니다. (저는이 모든 것을 처음 접했습니다.) 이 java pgm을 사용하여 대용량 파일을 대상 서버에 ftp로 작성했습니다. 내가 보내고있다 파일에 무슨 일이 일어나고 이상한FTP 클라이언트 문제
public static void ftpUpload(String path, String upfileName, String dirName) throws Exception
{
FTPClient client = new FTPClient();
client.addProtocolCommandListener((ProtocolCommandListener) new PrintCommandListener(new PrintWriter(System.out)));
client.enterLocalPassiveMode();
FileInputStream fis = null;
int reply;
try {
client.connect(ftpserver);
client.login(ftpuserid, ftppasswd);
reply = client.getReplyCode();
if(FTPReply.isPositiveCompletion(reply)){
client.changeWorkingDirectory(ftpdirectoryName + "/" + dirName);
boolean mkDir = client.makeDirectory(getCurrentMMMYY().toLowerCase());
client.changeWorkingDirectory(getCurrentMMMYY().toLowerCase());
//Create an InputStream of the file to be uploaded
fis = new FileInputStream(path + upfileName);
//Store file to server
client.storeFile(upfileName, fis);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fis != null) {
fis.close();
}
client.logout();
//client.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
뭔가 ... 크기 발신 서버 내 파일의 하나입니다 82575786, 그리고 : 은 여기 (코드는 디스플레이에 대한 약간의 수정 된) 코드입니다 이 파일을 ftp로 보내면 거의 전체 파일을 보냅니다. 실제로 82574867을 보냅니다. (누락 된 919) 원본 서버의 다른 파일은 717885이며이 파일을 ftp로 보내면 거의 전체 파일을 보냅니다. 실제로 717522를 보냅니다. (누락 363)
나는 로그를 가져와 충돌이 발생했는지 확인했지만 전송에는 아무런 문제가없는 것으로 나타났습니다. 다음은 전송을 나타내는 2 개의 로그 항목입니다.
[08/09/11 20 : 21 : 13 : 618 EDT] 00000043 SystemOut 221 - 717522 바이트를 1 파일로 전송했습니다. 221- 1 파일에 82574867 바이트를 전송했습니다.
누구나 도움을 주실 수 있습니다. 감사합니다. Dan.
내가 요청할 수 있습니다을 그래서 whydoes sendfile은 하나의 입력 스트림 만 가져오고 작동하지 않습니다. 고마워! – 98percentmonkey