HOW TO: Retrieve photo and document names

When photos or documents are uploaded to flexmls by listing agents, users are given the ability to enter a publicly displayed name along with the attachment. These additional names can be used to help describe a picture by giving it context or explaining the location where the photo was taken.

Through the flexmls RETS server, these names are provided alongside the photos and documents that are retrieved. When a GetObject request is made, a “Content-Description” header is included (along with the other expected headers). The value of this header contains the name provided for that object.

For example, the following represents an example response from our RETS server:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Cache-Control: private
RETS-Version: RETS/1.7.2
MIME-Version: 1.0
Content-Type: multipart/parallel; boundary=”FLEXlwyQfTEG86CODzQzeRn8JNCpPMTCcbf4Vanu1FC8WeZe4BQzIZ”
Date: Tue, 17 Sep 2013 21:22:23 GMT
Connection: close
Content-Type: image/jpeg
Content-ID: 135099
Object-ID: 1
Content-Description: Front Exterior
Preferred: 1

(image data)
Content-Type: image/jpeg
Content-ID: 135099
Object-ID: 2
Content-Description: Expansive View of Rear of House

(image data)

The above response shows 2 photos returned by the GetObject request each with a “Content-Description” header describing the object.

You’ll need to consult the documentation for the tool you’re using to determine the best way to extract this information. For users of libRETS, GetDescription() can be used to retrieve that value. For users of PHRETS, the “Content-Description” key is available for each object.

Comments on this entry are closed.