Uplaod image byte[] with POST
<p>How to send Image or Video with post request with lot off other parameters with post request ? I have image and video in byte[] format and I am trying like </p>

<pre><code>  HttpClient httpClient = new DefaultHttpClient();
            http.setURI(URI.create(url));
            MultipartEntity reqEntity = new MultipartEntity(
                HttpMultipartMode.BROWSER_COMPATIBLE);
                  ByteArrayBody bab = new ByteArrayBody(a.getData(),
                      a.getQuestionId() + ".jpg");
                  reqEntity.addPart("type", new StringBody("photo"));            
                  reqEntity.addPart("data", bab);
 http.setEntity(reqEntity);
              HttpResponse response = httpClient.execute(http);
</code></pre>

<p>it pass through code but it doesn't upload anything ( bab !=null ). Does anybody have any idea what is wrong, I cannot provide more info, other team is at ws ?</p>
