我正在尝试将Livecode中的HTTP POST请求发送到send服务。
这是Livecode中的代码:
put 8 into tId
put the text of field "image_text" into tBlop
put tBlop into field "image_text"
put "id=" & tId & "&blop=" & base64Encode(tBlop) & "&pic=" &tBlop into tArgList
post tArgList to URL "http://www.example.com/api_donation/blop2"
put it into tFormResultswebservice是使用Slim框架用PHP编写的。
$id = $app->request->post('id');
$blop = $app->request->post('blop');
$pic = $app->request->post('pic');
// decode image
$blop = base64_decode($blop);
$db = getDB();
$sql = "INSERT INTO picture (id, blop, pic) VALUES ($id, $blop, $pic)";
$stmt = $db->prepare($sql);
//execute sql statement
$res = $stmt->execute($data);但是,当图像被插入到db中,并且我试图在Livecode中获得它时,存储在db中的图像不是有效的图像。
此错误的原因是编码吗?我是否需要更改数据库中的某些设置(例如utf-8)?
谢谢你的帮助!
发布于 2017-05-24 14:39:52
图像的属性imageData (二进制)或text (ASCII)是与屏幕上显示的内容有关的livecode属性。它们不是bmp,jpg,png或任何其他格式。
如果需要创建有效的格式,则需要导出命令。
请参阅http://livecode.wikia.com/wiki/Export
https://stackoverflow.com/questions/35155220
复制相似问题