현재 ftp로 스마트폰의 파일을 알ftp서버로 전송하는 어플을 만들고 있습니다.

 

에뮬에서sd카드 설정후에 파일익스플로러에 있는 sd카드 폴더에 push file버튼을 이용해서 텍스트 파일을 넣고 전송하는데

 

알ftp에서는 데이터콘넥션을 열고 file received ok라고 나오는데 파일 전송은 안되고 에뮬은 멈춰버립니다

 

도와주세요

 

코드는 아래와 같이 버튼4를 누르면 업로드 하도록 했습니다.

서버 접속과 로그인 까지는 되었습니다. 알ftp에서 접속수가 올라가고 로그인까지 되는거 확인했습니다.

btn4.setOnClickListener(new Button.OnClickListener() {  //업로드 
         public void onClick(View v){          
          
                InputStream input = null;
           File local = null;
           //String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/123.txt"; // sd카드 주소 받기
           File sourceFile = new File("/mnt/sdcard/12333.txt"); 
           
           local = sourceFile;
           try {
           input = new FileInputStream(local);
          } catch (FileNotFoundException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
          }
          
          try {
           if(ftpClient.storeFile(sourceFile.getName(), input)){
            st.setText("업로드 했습니다.");  
           }
          } catch (IOException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
          }    
          
         }
        });