How to store images in MySQL server using android

2019-09-19 03:01发布

问题:

I'm creating a application using camera options in that one the captured images are stored in the MySQL server using soap web service.

I created a URL using Asp.net,the data type of the images are byte[],In my android coding I'm too convert image into byte[].The problem if i use

request.add Property("Photo",image);//image is the byte[] variable //the above code using soap web service in android

it doesn't store in my sql server table. How can i do that one? Thanks in advance

回答1:

What you have to do is convert that byte array into a string, and then you store the string in your database. Then, when you retrieve it, you will convert it back into a byte array, and then into a bitmap.

Error when trying to encode/decode String to Base64