Real Estate Forums
| Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here. |
![]() |
|
|
Thread Tools | Display Modes |
|
|||
|
I'm running PHP 5.0.4 on Windows Server 2003.
I'm currently working on a real estate website that dynamically pulls information from a RETS server. This server holds data about homes for sale on the MLS. Here is the problem: I'm trying to pull the images of a house from the server. I get all of the header information and then the binary data stream (I think it's bindary) as seen below. I am trying to display this image: [code]HTTP/1.1 200 OK Date: Wed, 21 Sep 2005 01:05:24 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET (03) X-AspNet-Version: 1.1.4322 MIME-Version: 1.0 Object-ID: 1 Content-Description: Content-Length: 28211 RETS-Version: RETS/1.5 Cache-Control: private Content-Type: image/jpeg Code:
JFIFKKC
$.' ",#(7),01444'9=82<.342C
2!!22222222222222222222222222222222222222222222222222,"
ĵ}!1AQa"q2#BR$3br
%&'()*456789& #58;CDEFGHIJSTUVWXYZcdefghijstuvwxyz
ĵw!1AQaq"2B #3Rbr
$4%&'()*56789& #58;CDEFGHIJSTUVWXYZcdefghijstuvwxyz
?"p@:JHG*Q /)CA
J((]"~B]"F))n>|7EE.(&?N})1K>/(I?Fh)> ϰ?!E~B4qA
Ky..%Hany=q^<e&{5ڄ&j>(ҽwWb3տ⸍_WP
M;(~Mh껕pfQ(노5f%%G&=+H-<I *mIGFoc4;L ?n ;c>pWA۸A@<Gkڋ=PD8ogEj`}(}!\uqik>Kz^*zi= NA
7A
J) 6PA
7A
m~B~B>d~BE. (plus many more characters...)
Thanks for the help... |
|
|||
|
Hi ... Is getting the binary data for the is the only option? I have set up a connection with a RETS server, and I was able to just download the full image file, but anyways... Maybe something like this will help you ...
file1.php Code:
<html> <body> <img src="1b.php"> </body> </html> Code:
<?php
header("Content-type: img/jpeg");
$filename = "filename.jpg";
$fp = fopen($filename, "rb");
$image = fread($fp, filesize($filename));
fclose($fp);
echo $image;
?>
|
|
|||
|
Did you ever get this figured out?
I am running into the same problems. |
|
|||
|
Not really, seems to be very difficult to pull images from a RETS server.
I continue to run into this problem also. |
|
|||
|
I don't have a problem getting the images, but they come down encoded, but I can't figure out how they are encoded.
I am using PHP and have tried decoding them using every method I can think of. Are you even able to pull the binary? If not I can give you my PHP code that does it. |
|
|||
|
All images are binary. You have to write them as binary objects not as text objects.
Also, 99.9% of MLS's do not allow you to dynamically pull images for each display liek that. You have to download them locally once and use them from your local system. |
|
|||
|
Like RobertD said, all images are binary. Looks like the code example you've posted is in ASCII. I don't know if your MLS is storing the pics in their database in BLOB (Binary Large Object) fields - instead of in a simple folder as complete MIME files, which is a lot faster - but it's a bad idea if they are because you have to reconstruct them pixel-by-pixel...and then store them. At any rate, you're getting the wrong data type.
__________________
LanGard MicroDevelopers Oregon Real Estate Agent and Company Directory |
|
|||
|
No, it's not the way the MLS is storing them or sending them. It's 100% the way that they are writing them. The photos are sent as binary streams, and you have to write the photos as binary objects.
|
|
|||
|
In that case you can do it out of the PHP Manual.
__________________
LanGard MicroDevelopers Oregon Real Estate Agent and Company Directory |
|
|||
|
I have tried everything I could think of to get the binary stream to form into a picture using the GD library. I was unable to figure it out.
Instead, I just use the fget and similiar commands to pull the image straight from their server and store it locally. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|