[Zope] Set MIME type using ZPT
srikanth
srikanth.m at monsterfirst.com
Tue Apr 5 16:11:15 EDT 2005
Hi,
I am using an external method to load an Image from the harddrive. The
external method is as follows:
from email.MIMEImage import MIMEImage
##parameters=filename
def getDocument(filename):
fname = '/mnt/'+filename;
input = open(fname,'r')
content = MIMEImage( input.read( ) )
input.close( )
return content
When I try to display the content in the webpage what I actually got is
all raw data of the file rather the image.
So how can I convert the raw data to be dispalyed as image in the
webpage. I am using ZPT to display the web page (image). If its dtml I
could have used <dtml-mime> tag is there any equivalent to that in ZPT.
Any suggestion would be a gr8 help.
Ta.
More information about the Zope
mailing list