[Zope] 'import' directory accesible from scripting.

Luis Lavena luislavena at hotmail.com
Wed Aug 27 22:10:24 EDT 2003


I think that I start getting the picture:
(please correct me if I'm wrong)

What I need is my own Folderish (ObjectManager implementation) with a 
customized manage_importObject() which at the same time call 
_importObjectFromFile() to handle the "real" file import process.

Now the thing is: the database (ZODB) Connection is which parses the file, 
and take a filename string or a "file" object that support read() function, 
how do I "mask" the OFS.File object to provide a read() function?

just adding a "hook" to the OFS.File that handle the self.data?

Ok, hope this wasn't to basic, newbie or stupid for you ;)

Thanks for your time. Please excuse my poor english.

Luis Lavena

PS: The FTP was another stupid idea: use a 3rd party FTP with his home 
directory set to $INSTANCE_HOME/import for providing a workaround to .zexp 
importing.

----Original Message Follows----
From: Dieter Maurer <dieter at handshake.de>
To: "Luis Lavena" <luislavena at hotmail.com>
CC: <zope at zope.org>
Subject: Re: [Zope] 'import' directory accesible from scripting.
Date: Wed, 27 Aug 2003 21:11:36 +0200

Luis Lavena wrote at 2003-8-26 04:07 -0300:
  > ...
  > Q: Is there a way to handle the upload and import process by a product 
(to
  > be created) to bypass this security?

Sure!

Look at the implementation of the import functionality.
It consists of two parts: locating the file and importing from this
file.

You can use the second part and solve the first part in any
appropriate way. Almost surely, the "file" object do not need
to be a real file, a file like object will probably sufficient.

  > or must relly on a limited FTP server
  > that only allow me upload information to the "import" directory?

This has nothing to do with FTP.

You can even use FTP (together with a "PUT_factory" (see Zope.org,
for details)) to upload "zexp"s. Note, however, that this would be a
security risk.

Dieter

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Zope mailing list