 <p>Please try this code:</p> <pre><code>package com.secondhandbooks.http; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Dictionary; import java.util.Enumeration; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.BufferedHttpEntity; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; import org.json.JSONObject; import android.app.ProgressDialog; import android.content.Context; import android.os.AsyncTask; import android.util.Log; import com.secondhandbooks.util.ConvertStreamIntoString; import com.secondhandbooks.util.SaveImageIntoDrawable; public abstract class BaseAsync_Post extends AsyncTask&lt;String, String, InputStream&gt; { Context context ; private HttpPost httppost; String url ; Dictionary&lt;String, String&gt; dictionary ; public BaseAsync_Post(String url , Dictionary&lt;String, String&gt; dictionary, Context context) { this.url = url ; this.dictionary = dictionary; this.context = context ; Enumeration&lt;String&gt; enumeration = dictionary.keys() ; showLogs("constructor") ; while ( enumeration.hasMoreElements() ) { showLogs( enumeration.nextElement() ) ; } } @Override abstract protected void onPreExecute() ; @Override abstract protected void onPostExecute(InputStream result) ; @Override protected InputStream doInBackground(String... params) { // TODO Auto-generated method stub // TODO Auto-generated method stub InputStream is = null; HttpClient httpclient = new DefaultHttpClient(); httppost = new HttpPost(url); MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); try { List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(50); Enumeration&lt;String&gt; enumeration = dictionary.keys() ; while ( enumeration.hasMoreElements() ) { String key = enumeration.nextElement() ; if ( key.equals("file") ) { final File file = new File(SaveImageIntoDrawable.savedImagePath); if ( file.isFile() ) { showLogs("is file"); } else { showLogs("no-file"); } FileBody fb = new FileBody(file); entity.addPart(key, fb); } else { entity.addPart(key, new StringBody(dictionary.get(key))); } } httppost.setEntity(entity); HttpResponse response = httpclient.execute(httppost); HttpEntity entity1 = response.getEntity(); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity1); is = bufHttpEntity.getContent(); } catch (ClientProtocolException e) { e.printStackTrace(); showLogs("ClientProtocolException"); } catch (IOException e) { e.printStackTrace(); showLogs("IOException"); } return is; } public String getString(JSONObject json, String TAG) { String returnParseData = ""; try { Object aObj = json.get(TAG); if (aObj instanceof Boolean) { returnParseData = Boolean.toString(json.getBoolean(TAG)); } else if (aObj instanceof Integer) { returnParseData = Integer.toString(json.getInt(TAG)); } else if (aObj instanceof String) { returnParseData = json.getString(TAG); } else { returnParseData = json.getString(TAG); } } catch (Exception err) { err.printStackTrace(); returnParseData = ""; } return returnParseData; } public String getIntintoString(JSONObject json, String TAG) { int returnParseData = -1; try { returnParseData = json.getInt(TAG) ; } catch (Exception err) { err.printStackTrace(); returnParseData = -1; } return Integer.toString(returnParseData) ; } public void showLogs ( String msg ) { Log.e("HTTP-POST", msg) ; } } </code></pre>