[Rets-dev] Photos

Gary Miller gary.miller at lucero.com
Thu Mar 8 14:49:52 CST 2007


Libor and others

I'm probably missing the obvious but here is what I'm trying to do.

 

In C# I simply want to ready the stream into a byte array and then write the
byte array to a file.  However the stream that is returned by the GetObject
request doesn't support "seek" type operations so I cannot tell the length
of the stream.

 

What am I missing?

 

Here is the code I'm attempting to use.

 

                Stream strm = getobject.ResponseStream;

                long i = strm.Length;

                byte[] a = new byte[i];

                strm.Read(a, 0, a.Length);

                FileStream fs = new FileStream(@"c:\test.jpg",
FileMode.Create);

                fs.Write( a, 0, a.Length);

                fs.Close();

 

Gary Miller

 

 

 

 

From: Libor Viktorin [mailto:lviktorin at marketlinx.com] 
Sent: Thursday, March 08, 2007 7:56 AM
To: Gary Miller; rets-dev at rets.org
Subject: RE: [Rets-dev] Photos

 

If you're asking about RETS 1.x, then yes.

If the request has been for only one photo (ID=entity:n, where n is not an
asterisk), the body of the response is usually the jpg (or other image)
file, unless there was any problem, in which case the response is usually
regular xml <RETS> response with non-zero reply code.

If more than one photo has been requested, a multipart response is returned
(See the specs, chapter 5.11).

 

Libor

 

 

  _____  

From: rets-dev-bounces at rets.org [mailto:rets-dev-bounces at rets.org] On Behalf
Of Gary Miller
Sent: Wednesday, March 07, 2007 10:59 PM
To: rets-dev at rets.org
Subject: [Rets-dev] Photos

 

I know I'm not the first person to ask but.  

 

Are photos returned in a byte stream from the GetObject Transaction or ?

 

Thanks.

 

Gary Miller

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rets.org/pipermail/rets-dev/attachments/20070308/275bf283/attachment.html


More information about the Rets-dev mailing list