【发布时间】:2013-01-23 15:36:21
【问题描述】:
我在 ImageView 中有用户选择的图像...如何使用 php 将其插入 mysql 数据库表?
谁能帮帮我。
我希望图像保存在上面的列类型是 Blob。
【问题讨论】:
-
@jtheman imageView.buildDrawingCache(); bmIcone = imageView.getDrawingCache(); ByteArrayOutputStream 流 = 新的 ByteArrayOutputStream(); bmIcone.compress(Bitmap.CompressFormat.PNG, 90, 流); byte [] byte_arr = stream.toByteArray();字符串 image_str = Base64.encodeBytes(byte_arr); namevaluepair.add(new BasicNameValuePair("image",image_str)); php 代码 $base= $_REQUEST['image']; $buffer = base64_decode($base);