1
FTPClient의 storeFile (원격, 로컬) 메소드를 사용하여 하나의 대용량 파일 (8MB 이상)을 업로드하려고하지만 오류가 발생합니다. 업로드됩니다. 출력은 다음과 같습니다.Apache commons-net-3.1을 사용하여 FTP에 대용량 파일을 업로드 할 수 없습니다.
public class Main {
public static void main(String[] args) {
FTPClient client = new FTPClient();
FileInputStream fis = null;
try {
client.connect("208.106.181.143");
client.setFileTransferMode(client.BINARY_FILE_TYPE);
client.login("abc", "java");
int reply = client.getReplyCode();
System.out.println("Received Reply from FTP Connection:" + reply);
if(FTPReply.isPositiveCompletion(reply)){
System.out.println("Connected Success");
}
client.changeWorkingDirectory("/"+"Everbest"+"/");
client.makeDirectory("ETPSupplyChain5.3-EvbstSP3");
client.changeWorkingDirectory("/"+"Everbest"+"/"+"ETPSupplyChain5.3-EvbstSP3"+"/");
FTPFile[] names = client.listFiles();
String filename = "E:\\Nitin\\D-Drive\\Installer.rar";
fis = new FileInputStream(filename);
boolean result = client.storeFile("Installer.rar", fis);
int replyAfterupload = client.getReplyCode();
System.out.println("Received Reply from FTP Connection replyAfterupload:" + replyAfterupload);
System.out.println("result:"+result);
for (FTPFile name : names) {
System.out.println("Name = " + name);
}
client.logout();
fis.close();
client.disconnect();
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
o/p:
Received Reply from FTP Connection:230
Connected Success
32 /Everbest/ETPSupplyChain5.3-EvbstSP3
Received Reply from FTP Connection replyAfterupload:150
result:false
안녕하세요, FTPClient의 storeFile (원격, 로컬) 메소드가 FTP에 파일 업로드를위한 크기 제한이 있다면 알려 주시기 바랍니다. – Nitin