[Zope] manage_upload and file objects

Phil Harris phil.harris@zope.co.uk
Thu, 28 Jun 2001 14:39:28 +0100


Sedat,

You need to use the read() method of the filelike object:

doc.manage_upload( base64.decodestring(REQUEST.file.read()))

hth

btw,  any mail sent to the Zope list should be plain text only, please do
not send HTML formatted mail to this list.  See the Signature at the bottom
of most mails for further info.  Thanks in advance.

Phil
phil.harris@zope.co.uk

----- Original Message -----
From: Sedat Yilmazer
To: zope@zope.org
Sent: Thursday, June 28, 2001 2:25 PM
Subject: [Zope] manage_upload and file objects



 I have a special httpd clinet that sends the file encoded as base64 . In
the DocLibrary product  they have

  doc.manage_upload(REQUEST.file)


 I want to change that to something similar to

 doc.manage_upload( base64.decodestring(REQUEST.file))

 But manage_upload  waits for a file or an object that mimics a file and
base64.decodestring needs a string ( base64.decode( f1,f2) needs f1 and f2
as file)

so I need an object that mimics a file so I can

 decoded ( file object ??)

 base64.decode(REQUEST.file, decoded)
 doc.manage_manageupload( decoded )

 is there such an object ? Any suggestions ?

Sedat Yilmazer
Kibele Iletisim Sis. ve Serv. Ltd.