title: How to upload a image to server using HttpPost in android?
body: <p>Here is my code to send some DATA to php server in Json format using HttpPost. How can i upload a image along with the DATA ?</p>
  
  <pre><code>HttpPost httppost = new HttpPost(urlToSendCheckListReport);  
  JSONObject json = new JSONObject();
          // prepare JSON data:
          json.put("tag_id", tagID);
          json.put("building_id", buildingID);
          json.put("timestamp", new SimpleDateFormat("dd-MM-yyyy, HH:mm:ss").format(Calendar.getInstance().getTime())); 
  
          JSONArray postjson=new JSONArray();
          postjson.put(json);  
  
          // Post the data:
          httppost.setHeader("json", json.toString());
          httppost.getParams().setParameter("jsonpost",postjson);  
  
     HttpResponse response = new DefaultHttpClient().execute(httppost);
  
      if(response != null)
      { 
       .....Read the response
      }
  </code></pre>
  
  <p>Thanks in advance</p>