[Zope] image uploading problems: changing of object type
R Karthick
catchkarthick at yahoo.com
Mon Jul 12 12:15:08 EDT 2004
hi!!
thank you for you reply.
Infact i changed the content-type to text/xml.
Eventhough the content_type of the file changes, it
still remains an "Image" and that gives me problems.
Can i change the type of the file using some api
function? It is like changing the type from
dtml-method to zpt file. similarly from Image to
ordinary "file".
Regards,
R K
--- Jonathan Hobbs <toolkit at magma.ca> wrote:
> 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
>
>
>
>
=====
with "freedom" comes great responsibilities
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
More information about the Zope
mailing list