title: image upload to web service in JavaScript
body: <p>I need to upload an image to a webservice from javascript. I have to send a json string an a file(image). In java we have <code>MultipartEntity</code>. I have the followig code in java:  </p>
  
  <pre><code>HttpPost post = new HttpPost( aWebImageUrl2 );
  MultipartEntity entity  = new MultipartEntity( HttpMultipartMode.BROWSER_COMPATIBLE );
  // For File parameters
  entity.addPart( "picture", new FileBody((( File ) imgPath )));
  // For usual String parameters
  entity.addPart( "url", new StringBody( aImgCaption, "text/plain", Charset.forName( "UTF-8" )));
  post.setEntity( entity );  
  </code></pre>
  
  <p>Now I need to do the same image upload in javascript.<br>
  But in javaScript I didn't find any equivalent of MultipartEntity. Please Suggest any solutions.</p>