[Zope] How to read a file object

Tino Wildenhain tino at wildenhain.de
Wed Jun 1 09:10:26 EDT 2005


Am Mittwoch, den 01.06.2005, 15:02 +0300 schrieb Vital Lobachevsky:
> John Poltorak wrote:
> > On Wed, Jun 01, 2005 at 12:46:44PM +0200, Andreas Jung wrote:
> > 
> >>
> >>--On 1. Juni 2005 10:01:22 +0100 John Poltorak <jp at warpix.org> wrote:
> >>
> >>
> >>>
> >>>How do I go about reading a Zope file object in Python?
> >>
> >>Define what "reading a Zope File object" means? You mean you want the
> >>body of an upload file?
> >>
> >>-aj
> > 
> > 
> > 
> > I mean the thing that is created when I click on 'File' from the drop down 
> > menu of ZMI.
> 
> Suppose your file 'myFile' and your script 'myScript' in the same 
> folder. You can get file data in your script using 'data' property:
> 
> fileData = container.myFile.data
> ...

beside the fact its a not really public attribute, it isnt
even garantied to be s simple string. Most of the time
its a Pdata object chain.

And yes, file/image really lack file semantics.
-- 
Tino Wildenhain <tino at wildenhain.de>



More information about the Zope mailing list