title: Upload Image file to Http Server using post method in android
body: <p>I need to upload image file to http server using post method.
  My code is here </p>
  
  <pre><code>try {
  HttpClient httpclient = new DefaultHttpClient();
  
  HttpPost httppost = new HttpPost(url);
  
  InputStreamEntity reqEntity = new InputStreamEntity(
          new FileInputStream(file), -1);
  reqEntity.setContentType("binary/octet-stream");
  
  httppost.setEntity(reqEntity);
  HttpResponse response = httpclient.execute(httppost);
  //Do something with response...
  
  } catch (Exception e) {
  // show error
  }
  </code></pre>
  
  <p>It's not working.Suggest me the right way. </p>
  
  <p>Note : Server is IIS server.</p>