안녕하세요 안드로이드 열공중인데요.. 무지에서 시작하려니 막히는 부분이 많네요.

그래도 여기에서 많은걸 배우면서 하고있는데요.. 지금 하고있는게 SDCARD 에 있는 이미지를 전송해서 웹서버에 저장하는 작업을 테스트 중인데요..

SDCARD에 있는 yoo.jpg 를 http://192.168.10.1/test.asp 로 멀티폼으로 전송시켜 서버에 저장하려고 하고있습니다.

오픈되어있는 소스로 하니까 에러 로그부분에

this is error java.lang.IllegalArgumentException: file /sdcard/yoo.jpg contains a path separator

이런 로그가 있던데 이건 어떠한 에러인지 알려주시면 너무 너무 감사..

외국사이트까지 다 찾아가면서 해보는데도 해결이 안되서 이렇게 문의드립니다.

이것때문에 몇일째 골머리 썩고 있거든요..

알고계신분은 제발 PLZ~~~~ 부탁드립니다.

사용하고있는  예제 소스...

=====================================================================================

 String exsistingFileName = "/sdcard/yoo.jpg";
 String lineEnd = "\r\n";
 String twoHyphens = "--";
 String boundary = "*****";
 String urlString="http://192.168.10.1/test.asp";
 HttpURLConnection conn;
 DataOutputStream dos;
   
    try{
     
        FileInputStream fileInputStream  = openFileInput(exsistingFileName);
        InputStreamReader isr = new InputStreamReader(fileInputStream );
        char[] inputBuffer = new char[fileInputStream .available()];
        isr.read(inputBuffer);
        String readString = new String(inputBuffer);
       
        Log.d("Test", "from file"+readString);
        //tv.setText("from file"+readString);     // ----------> It is reading text from file.
       
        URL url = new URL(urlString);


     // Open a HTTP connection to the URL

     conn = (HttpURLConnection) url.openConnection();

     // Allow Inputs
     conn.setDoInput(true);

     // Allow Outputs
     conn.setDoOutput(true);

     // Don't use a cached copy.
     conn.setUseCaches(false);

     // Use a post method.
     conn.setRequestMethod("POST");

     conn.setRequestProperty("Connection", "Keep-Alive");

     conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary);

     dos = new DataOutputStream( conn.getOutputStream() );

     dos.writeBytes(twoHyphens + boundary + lineEnd);
     dos.writeBytes("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + exsistingFileName +"\"" + lineEnd);
     dos.writeBytes(lineEnd);

//      Log.e(Tag,"Headers are written");

     // create a buffer of maximum size
    int maxBufferSize=1024;
    int bytesAvailable = fileInputStream.available();
    int bufferSize = Math.min(bytesAvailable, maxBufferSize);
    byte[] buffer = new byte[bufferSize];

     // read file and write it into form...

     int bytesRead = fileInputStream.read(buffer, 0, bufferSize);

     while (bytesRead > 0)
     {
     dos.write(buffer, 0, bufferSize);
     bytesAvailable = fileInputStream.available();
     bufferSize = Math.min(bytesAvailable, maxBufferSize);
     bytesRead = fileInputStream.read(buffer, 0, bufferSize);
     }

     // send multipart form data necesssary after file data...

     dos.writeBytes(lineEnd);
     dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);

     // close streams
  //   Log.e(Tag,"File is written");
     fileInputStream.close();
     dos.flush();
     dos.close();

 

      
    }catch(Exception e){
     
      Log.e("ERROR", "this is error : "+e.toString());
     //tv.setText("this is error"+e.toString());
     }


}
}

================================================================================