[Zope] How can I test for type of image

Casey Duncan cduncan@kaivo.com
Fri, 29 Jun 2001 08:46:07 -0600


> Robert Rottermann wrote:
> 
> Hi there,
> I would like to test of what type an image is. How can I do that?
> I think I saw some code once but can not find it anymor.
> 
> Thanks for your tips
> Robert

If it is an Image or File object in zope then:

image.content_type

will give it to you.

If you are looking to check the type of a file uploaded from a form,
then:

file.headers['content-type']

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>