2014-09-29 1 views
0

사용하여 FTP 서버에 저장된 이미지 파일을 수정하지만 난 다음과 같은 예외가 점점 오전하는 방법 :읽고 내가 FTP 서버에 저장된 이미지의 thumbanials을 만들고 싶어 자바

javax.imageio.IIOException: Can't read input file! 

코드 :

String curr_input_img = null; 
    BufferedImage original_img = null; 
    String finalfolderpath = AppConstants.FTP_PATH + path; 
    String thumbailpath = finalfolderpath + "/thumbnail"; 
    FTPClient client = new FTPClient(); 
    try{ 
    client.connect("188.148.12.58"); 
    client.login("root", "admin123"); 
    boolean result = client.changeWorkingDirectory(finalfolderpath); 
    FTPFile[] ftpfiles = client.listFiles(); 
    if (result == true) { 
     client.makeDirectory("thumbnail"); 
     for (FTPFile ftpfile : ftpfiles) { 
      curr_input_img = ftpfile.getName(); 
        original_img = ImageIO.read(new File(curr_input_img)); // read original image 
      } 
    } 
    catch (Exception ex) { 
    System.out.println(ex); 
    } 
+0

검사에 공급. URL, 자격증 명 및 네트워크 연결 –

+0

읽기 및 쓰기 권한이 없으므로 .... 읽는 방법은 무엇입니까? –

답변

0

을 로컬 파일 시스템에서 파일을 읽으려고합니다.

파일을 다운로드하고 편집하고 다시 업로드해야합니다.

당신은 InputStream를 얻을 수 FTPClient.retrieveFileStream()를 사용하여 다음 사용 권한에 대한 ImageIO.read

+0

그래서 각 mininum 100 개의 파일을 가지고 있으므로 각 파일은 거의 50MB 정도 큽니다 ...? –

+0

하드 드라이브에 50MB가 없으면 파일로 작업 할 수있는 라이브러리를 입/출력 스트림으로 찾으십시오. – talex

관련 문제