Server side(Servlet) code for upload image in android
<p>I want server side java code to save image upload from a android device
here is my client side code...........
 public static void uploadPictureToServer(String i_file) throws ClientProtocolException, IOException {
         Bitmap bitmapOrg = BitmapFactory.decodeFile(i_file);</p>

<pre><code>             ByteArrayOutputStream bao = new ByteArrayOutputStream();

             bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 90, bao);

             byte [] ba = bao.toByteArray();

             String ba1=Base64.encode(ba);

             ArrayList&lt;NameValuePair&gt; nameValuePairs = new

             ArrayList&lt;NameValuePair&gt;();

             nameValuePairs.add(new BasicNameValuePair("image",ba1));

             try{

             HttpClient httpclient = new DefaultHttpClient();

             HttpPost httppost = new

             HttpPost(Constant.uploadImage);

             httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

             HttpResponse response = httpclient.execute(httppost);

             HttpEntity entity = response.getEntity();

             is = entity.getContent();

             }catch(Exception e){

             Log.e("log_tag", "Error in http connection "+e.toString());

             }
</code></pre>
