Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File file = new File(filepath);
- HttpClient client = new DefaultHttpClient(); //DefaultHTTPClient is deprecated?
- HttpPost post = new HttpPost(url);
- //Multipart Entity is also deprecated??
- MultipartEntity entity = new MultipartEntity();
- entity.addPart("file[path]", new FileBody(file));
- post.setEntity((HttpEntity) entity);
- try {
- HttpResponse response = client.execute(post);
- } catch (IOException e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement