Guest User

Untitled

a guest
Feb 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. public void Uploader() throws ClientProtocolException, IOException{
  2.        
  3.        
  4.         file = new File( local_file_path , file_name);
  5.         bin = new FileBody(file);
  6.         httppost = new HttpPost( url_string );
  7.         httpclient = new DefaultHttpClient();
  8.        
  9.         reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
  10.         reqEntity.addPart("schools", bin);
  11.        
  12.         httppost.setEntity(reqEntity);  
  13.        
  14.         response = httpclient.execute(httppost);  
  15.         resEntity = response.getEntity();  
  16.        
  17.         if (resEntity != null) {    
  18.                   Log.i("RESPONSE",EntityUtils.toString(resEntity));
  19.             }
Add Comment
Please, Sign In to add comment