Cannot get Photo in RETS(REAL ESTATE TRANSACTION SYSTEM) using PHRETS class
I am using PHREST class for getting photo from RETS Server I can get its city,state,zip and price but I am not able to get images of property for that I am using below function
$photos = $rets->GetObject("Property","Photo","05-020123:CLAW",1); print_r开发者_运维知识库($photos);
and here I am passed "05-020123:CLAW" this is UniqueID which I get from search query listing and I got below result:
Array ( [0] => Array ( [Success] => [Content-Type] => text/xml [MIME-Version] => 1.0 [Length] => 185 [Data] => [ReplyCode] => 20402 [ReplyText] => V2.5.0 640: The identifier does not match the KeyField of any data in the resource. Reason: An resource-entity must only contain digits. ) )
please help me out.
The 3rd parameter of GetObject() needs to simply be an ID.
If you go to www.retsmd.com and use your login information, you'll be able to determine the KeyField for the particular RETS class you're looking for. Once you know what field to look at, pull one of the values from that field from the property data and put that in place.
So if the KeyField is "ListingNumber", you might find 1234567 as the ListingNumber value for a record.
$photos = $rets->GetObject("Property", "Photo", "1234567");
foreach ($photos as $photo) {
print_r($photo);
}
That should spit out some binary image data for you. Check the samples on http://troda.com/projects/phrets/index.php?title=GetObject for further tips.
i would like to suggest use PHRETS before photo download please find either MLS IDX support 3rd party URL for Photo
$rets->GetObject() and Just var_dump() and check if support 3rd party URL no need to download Photo
if 3rd party URL Support then you need get_curl linux command for Get Photo.
精彩评论