private void fileUploadWithThumbnail(String attach_file_seq, String file_path, String user_id, String thumbnail) { File uploadFile = new File(file_path); MultipartEntityBuilder builder = MultipartEntityBuilder.create() //객체 생성 .setCharset(Charset.forName("UTF-8")) //인코딩을 UTF-8로 .setMode(HttpMultipartMode.BROWSER_COMPATIBLE); builder.addPart("file", new FileBody(uploadFile)); //빌더에 FileBody 객체에 인자로 File 객체를 넣어준다. builder.addTextBody("attach_file_seq", attach_file_seq, ContentType.create("Multipart/related", "UTF-8")); builder.addTextBody("user_id", user_id, ContentType.create("Multipart/related", "UTF-8")); builder.addTextBody("thumbnail", thumbnail, ContentType.create("Multipart/related", "UTF-8")); try { InputStream inputStream = null; HttpClient httpClient = new DefaultHttpClient(); HttpPost post = new HttpPost(server_domain + "/file/fileUploadDisk.json"); //전송할 URL HttpEntity multipart = builder.build(); post.setEntity(multipart); HttpResponse httpResponse = httpClient.execute(post); HttpEntity httpEntity = httpResponse.getEntity(); } catch (Exception e) { e.printStackTrace(); } }