从 iOS 应用程序到 php 脚本,我想将一组图像存储为 BLOB 类型:
$profile_images = $_REQUEST['profile_images_array'];//get the array of images
//loop the images and store them one by one
foreach($profile_images as $image){
$sqlinsertimages = "insert into profile_images (id_client,image) Values ('".$id."',mysql_real_escape_string('".$image."'))";
$result = mysql_query($sqlinsertimages);
}
如果我消除图像字段(这是 BLOB 类型),插入将正常工作,因此问题显然在于表中保存 BLOB 类型。
如何将 PHP 中的图像正确存储为 BLOB?
PS:不愿意采用文件系统存储。