0

I am sending image string from android to Php server using Base64 format. But at server end, full Image is not displaying. Only some upper part of Image is displaying. I used following code below

Bitmap bitmap2 = BitmapFactory.decodeFile(fileUri.getPath(), options);           
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    bitmap2.compress(Bitmap.CompressFormat.PNG, 90, stream); 
    byte [] byte_arr = stream.toByteArray();

    String image_str = Base64.encodeToString(byte_arr, Base64.DEFAULT);
    System.out.println("image_str >>>> " + image_str );

Here I am capturing photo then sending to server. I also reffer Image not encoded successfully but I didnt get solution.

Thank you.

Please help me.

1 Answer 1

0

Download Base64 class from here Base64 and replace it and try it again

Sign up to request clarification or add additional context in comments.

2 Comments

Which class should I replace ? I mean, are u talking about library.?
Instead of using android.util.base64 use the base64 class from this library

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.