14 Dec
2004
14 Dec
'04
4:03 p.m.
On 14 Dec 2004, at 15:55, Jens Vagelpohl wrote:
Thanks. For the record, my final code was:
image_file = context.restrictedTraverse('/LDML/images/ldml.gif') context.REQUEST.RESPONSE.setHeader('content-type', image_file.content_type) return image_file.data
That won't work if the file size is large and the data is stored in separate pData structures. You *must* do "return str(image_file.data)" to be on the safe side.
OK. I've added this - but it does seem counter-intuitive to coerce binary data to a string before returning it. And more to the point, where does one uncover secrets like this? Simon Forster