更新时间:2023-01-15 22:00:59
OK,我发现我的问题的解决方案
OK that i found a solution for my question
code在java中假设图像已经转换为位图:
code in java assuming that the image is already converted to bitmap:
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bmIcone.compress(Bitmap.CompressFormat.PNG, 90, stream);
byte[] byte_arr = stream.toByteArray();
String image_str = Base64.encodeBytes(byte_arr);
namevaluepair.add(new BasicNameValuePair("image", image_str));
在服务器:
$base= $_REQUEST['image'];
$buffer = base64_decode($base);
$buffer = mysql_real_escape_string($buffer);
然后插入$缓冲区表BLOB列类型
then inserting the $buffer to table blob column type