Rendering binary (image) data

Hi, All:

I am working on a RESTful mobile gateway. Recently a requirement for the mobile to retrieve images (and other binary data) has come up. I have an endpoint for retrieval of an image (to be stored) to be persisted on the mobile device, but wondering how best to render it in the response. The mobile gateway will manipulate the image (for size, etc), therefore direct retrieval via URL is not an option.

All of the endpoint return data in JSON, XML or WDDX, as per the format extension. For the media, I don’t want to encode it in a JSON response but rather simply return the image binary with appropriate mime type/subtype.

It appears that the renderData() method can utilize a “custom” type. Is this the best approach, or is there a better way?

Any direction appreciated as I don’t want to run too far down the path to a solution, only to have to redo it.

Cheers!

Kevin S. Anderson
INDURE Team Software Engineer
Intelligent Software Solutions Inc.
Global Enterprise Solutions Division

Yes, use custom content type.

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano