Code example for FileEntity

-1
    	new Thread(new Runnable() {
			public void run() { 
				try { 
					DefaultHttpClient httpClient = new DefaultHttpClient();
					HttpPost post = new HttpPost(url);  //-X PUT
					post.setEntity(new FileEntity(new File(Environment.getExternalStorageDirectory(), "Prism/test.jpg"), "image/jpeg"));  //@ - absolute path
					httpClient.execute(post);
				} catch(Exception e) {
					//-f, fail silently 
					//http://stackoverflow.com/questions/9487115/hitting-java-web-service-curl-or-urlconnection 
				} 
			} 
		}).start();
	} 
 
	private void takeSnapshot() { 
		timer.scheduleAtFixedRate(new TimerTask() {
			@Override 
			public void run() { 
                // get an image from the camera 
                camera.takePicture(null, null, picture);