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:
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]ÿØÿàJFIFKKÿÛC
$.' ",#(7),01444'9=82<.342ÿÛC
2!!22222222222222222222222222222222222222222222222222ÿÀ,"ÿÄ
ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚
%&'()*456789& #58;CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊ
ÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ
ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ
$4á%ñ&'()*56789& #58;CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉ
ÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?÷"p@Àè:éJÙï‘HÝGÐ*Q ¸ú/ýò)CAù
J((]ÇÐß"ÇÐ~B’Š]ÇÐß"ÇÑï‘F))n>‹ÿ|Š7Eÿ¾E.(Å&ãè?ï‘NÜ}ä)1KŠ>ƒò¼ú/ä(–€Áï‘I“è?ï‘FhÍ)>Ãò™ö ô¤ ϰü…ý?!E¿€ü…ú~B“4”¹ö£qÏAù
ŠââKy..%HaŒny°ª=Íq·úõî¶^<Ée§Áù&”{Ï5÷ûÇÚ„®&ìjë>(Ò½†™wWã‡b3ï‘Õ¿Ùúâ¸_WµðùšóP›íº´
ŒMØûª;(ÿëÖ~¯â‹MÔÚh껕pfQÓýÏþ(ÿõë…¸Žâîä5Æçf%€%‡êG&ªé«=+HÖ-<I *ÅmõØIGòåÇFŒöocúŠí4;L–¿•衆 ç°?Ýn‡· ð;c>ŸpW…A†Û¸ñèA¯@Ò<Gk«Ú‹=P£‡Dî8og×ÿ×Eï¸j`Ü}ýò(Ü}¿!\u†»q¢·Ùõik>K¶ùžþß÷“ý¾£¾z×^¬®ŠèÁ‘€*Àäzi= Nã·Aù
7Aù
J)» ü… ü…6”P·Aù
7Aù
míÇÐ~BÇÐ~B“´¹>ƒòdû~B›E.ãíù (plus many more characters...)
We have a PHP function that strips off the header information from the RETS server (that you now see above) so that all that remains is the binary data stream. Also, I am setting the headers on this particular page to content-type = image\jpeg and content-length = strlen(binarystream). I then reference this PHP page from the page that I am wanting to display the image on by <img src="displayimage.php">. From everything Ive seen, this should work however, all we get is a broken image link. Is there anything we should be or should not be doing to the binary data stream in order to display this data as an image?
Thanks for the help...