[Zope] Image problem

Eva Rowe erowe at freewayprojects.com
Mon Jan 12 12:09:56 EST 2004


Hello
I have added an image through the form as -

<form action="createimage" method="post" enctype="multipart/form-data">
   <input type="text" name="id">
   <input type="text" name="title">
   <input type="file" name="file">
   <input type="submit">
</form>

this is processed by a script called "createimage" as in your forms method 
defined:
## Script (Python) "doupload"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=id, title, file
##title=
##
context.Pictures.manage_addImage(id,title,file)

ALTHOUGH -
This does create the image in the Pictures folder.
But the type in the context are 'application/octet-stream'
and not as an image/jpeg as I need it to be.

HOW can I identify the correct type for the file in the code please
 
Many thanks
Eva Rowe




More information about the Zope mailing list