title: Retrofit image upload using Base64 in android
body: <p>I am trying to upload the image using retrofit in Base64 format.</p>
  
  <p>To convert bitmap to Base64,</p>
  
  <pre><code>public static String convertImageToStringForServer(Bitmap imageBitmap){
          ByteArrayOutputStream stream = new ByteArrayOutputStream();
          if(imageBitmap != null) {
              imageBitmap.compress(Bitmap.CompressFormat.JPEG, 60, stream);
              byte[] byteArray = stream.toByteArray();
              return Base64.encodeToString(byteArray, Base64.DEFAULT);
          }else{
              return null;
          }
      }
  </code></pre>
  
  <p>I do not want to upload the image using Typedfile.</p>
  
  <p>My request method is below,</p>
  
  <pre><code>        @Multipart
          @POST("/pingpong")
          void doPingpong(@Part ("access_token") TypedString accessToken,
          @Part("image") TypedString profileImage,
          @Part("pixels") TypedString doPingPong,Callback&lt;pixelsPing&gt; callback);
  </code></pre>
  
  <p>Base64 conversion is correct, but I am not getting the image on server. What am i doing wrong in the above?</p>