It use HttpClient-4.0.1, Httpmime4.0.1,
it need the mime4j. you can download here.
HttpClient client = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://yourUploadUrl");
FileBody file = new FileBody(new File("YourLocalFile"));
MultipartEntity reqEntity = new MultipartEntity();
reqEntity.addPart("image", file);
httppost.setEntity(reqEntity);
ResponseHandler responseHandler;
responseHandler = new BasicResponseHandler();
System.out.println( client.execute(httppost,responseHandler));
it need the mime4j. you can download here.
留言