我正在从 MLS RETS 服务器下载属性图像。当我使用GetObject
方法下载属性图像时,有时Getobject
方法不返回成功参数,然后图像不会下载到本地服务器上。有什么解决办法吗?
这是我的代码:
$photos = $rets->GetObject("Property", "Photo", $idata['propertymlsid'], "*", 0);
foreach ($photos as $photo)
{
$imgval="";
$imgval="{$photo['Content-ID']}-{$photo['Object-ID']}.jpg";
if ($photo['Success'] == true)
{
@file_put_contents("photos/{$photo['Content-ID']}-{$photo['Object-ID']}.jpg", $photo['Data']);
@mysql_query("insert into tableName (pro_mlsid,photos_name,image_date)values('".$idata['propertymlsid']."','".$imgval."','".date('Y-m-d h:i:s')."')");
}else
{
// in this section i want to download image. please suggest what to do here? . i have record for this image in database for but could not download it.
}
}
请通过代码。我想在上面代码的其他部分下载图像。