[Zope] image uploading problems: changing of object type

Jonathan Hobbs toolkit at magma.ca
Mon Jul 12 09:10:05 EDT 2004


From: "R Karthick" <catchkarthick at yahoo.com>
> I upload images in to a ftp upload enabled folder. My
> task is to base64 encode
> the images and put it into another directory. I base64
> encode the files using
> the external method. When i upload it, ZOPE takes the
> default type as image.
> Now if i rename the file into a *.dat file, then the
> encoding works.
>
> Now can i change the type of the object from "image"
> to ordinary "file" from a
> script python.

You can change the content type when you add the object:

contentType = 'image/jpeg'
folder.manage_addFile(id=thisId, file=filedata, title=afile,
content_type=contentType)

You can set contentType to any valid MIME type.

HTH

Jonathan





More information about the Zope mailing list