title: Using InputStream with MultipartEntityBuilder : apache error
body: <p>I am using MultipartEntityBuilder and i want to send  image on server. I have image Uri. Image may be local or not, so i get input stream and send it this way: </p>
  
  <pre><code>HttpClient httpclient = new DefaultHttpClient();
  JSONObject result;
  HttpPost httppost = new HttpPost("http://www.ezduki.ru/api/content/add/image/");
  InputStream iStream = con.getContentResolver().openInputStream(imageUri);
  MultipartEntityBuilder multipartEntity = MultipartEntityBuilder.create();
  multipartEntity.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
  multipartEntity.addTextBody("token", code);
  multipartEntity.addBinaryBody("file", iStream);
  httppost.setEntity(multipartEntity.build());
  HttpResponse response = httpclient.execute(httppost);
  HttpEntity entity = response.getEntity();
  result = new JSONObject(EntityUtils.toString(entity));
  </code></pre>
  
  <p>where con is  my main activity context (code runs in AsyncTask).
  I am trying to send local  file, and i get error from web server in result, here is log from web server:</p>
  
  <p>[Fri Dec 13 10:01:03 2013] [error] [client 93.157.241.232] (70014)End of file found: mod_wsgi (pid=28449): Unable to get bucket brigade for request.
  [Fri Dec 13 15:01:03 2013] [error] ERROR:django.request:Internal Server Error: /api/content/add/image/
  [Fri Dec 13 15:01:03 2013] [error] Traceback (most recent call last):
  [Fri Dec 13 15:01:03 2013] [error]   File "/var/www/ezduki/venv/lib/python2.6/site-packages
  .
  .
  .
  packages/django/core/handlers/wsgi.py", line 92, in _read_limited
  [Fri Dec 13 15:01:03 2013] [error]     result = self.stream.read(size)
  [Fri Dec 13 15:01:03 2013] [error] IOError: request data read error
  [Fri Dec 13 15:01:03 2013] [error] [client 93.157.241.232] mod_wsgi (pid=28709): Exception occurred processing WSGI script '/var/www/ezduki/app/wsgi.py'.
  [Fri Dec 13 15:01:03 2013] [error] [client 93.157.241.232] IOError: failed to write data</p>
  
  <p>How must i  use MultipartEntityBuilder  and InputStream  together? Sending file like this</p>
  
  <pre><code>File f = new File(filePath);
  multipartEntity.addPart("file", new FileBody(f));
  </code></pre>
  
  <p>works perfectly</p>