2

I have develop android app in which one UserProfile is there. I have send all details of user to server using Ksoap2. I also want to send image to server. But, i don't know how to send image to webservice using Ksoap2 in android.

I have take image from sdcard and convert it to ByteArray. Is there I have to send that parameter as ByteArray of image to webservice? I want to pass all details of user and image to webservice. How can I do this?

Urvashi
  • 439
  • 2
  • 6
  • 6

4 Answers4

2

You can convert the your image into base64 string,and then handle them again to image at server side.

Kakey
  • 3,936
  • 5
  • 29
  • 45
0

I tried following tutorial, you can also try it, android upload image to server .

user609239
  • 3,356
  • 5
  • 25
  • 26
0

You can send it as a Multipart file in a network call using retrofit 2 library. Kindly check this answer as a reference for detailed code snippet: https://stackoverflow.com/a/68511884/8391757

Michael
  • 411
  • 2
  • 6
  • 15
-1

You can convert the your image into base64 string,and then handle them again to image at server side. but it getting a poor quality of image