title: Is it a good practice to send images in base64 string from android to PHP?
body: <p>In my android application I Capture image or select image from gallery.
  then I encode that image in base64 string.
  then I send that image to PHP in JSON format or with normal post request.
  then I decode base64 string to PNG image and save on server.
  then save path of that image to mySQL image_url column.</p>
  
  <p>This is the way I am currently working now..Which create image file.. but sometime it creates corrupt image file(full black or 0 KB or 20 KB in size). and Picasso does not work on such files. It shows decoder failed error of picasso.</p>
  
  <p>This way reduces Image quality 1.5 MB image(on device) to 50 KB image (on server). my code for encoding to base64 is,</p>
  
  <pre><code>`   // method for bitmap to base64
      public static String encodeTobase64(Bitmap image) {
          Bitmap immage = image;
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          immage.compress(Bitmap.CompressFormat.PNG, 100, baos);
          byte[] b = baos.toByteArray();
          String imageEncoded = Base64.encodeToString(b, Base64.DEFAULT);
          return imageEncoded;
      }`
  </code></pre>
  
  <p>If anyone have suggestions please help. or other way for sending and saving images.</p>
  
  <p>EDITS are welcomed.</p>