Fwd: Re: [Zope] External files

Thomas Olsen tol@tanghus.dk
Wed, 11 Jul 2001 22:23:04 +0200


I just found out that I forgot to cc this to the list:

----------  Forwarded Message  ----------

Subject: Re: [Zope] External files
Date: Tue, 10 Jul 2001 23:59:33 +0200
From: Thomas Olsen <tol@tanghus.dk>
To: Dieter Maurer <dieter@handshake.de>

OK - I'll try to be a bit more clear :-)

The File('www/my.jar') was simply my unqualified guess that when you could
make a DTMLMethod object using DTMLFile('dtml/editForm', globals()) then
maybe you could create a File Object doing something similar ;-} - but that
wasn't so...

What I wan't to do is to create some File objects using python containing a
jar file (application/x-jar) and a java class file (application/x-java).

When I do it using the web management screens (Select type to add... => File)
everything works ok but I cant find out how to do it programmatically.

On Tuesday 10 July 2001 20:30, you wrote:
> Thomas Olsen writes:
>  > This is propably an FAQ but I couldn't find an answer to it:
>  > I'm extending a product which has a java applet on one of the management
>  > screens. How do I get the class file and the jar?
>  > I've tried something like:
>  >
>  > --cut-------------
>  > def my_jar(self, REQUEST):
>  >     return self._my_jar
>  >
>  > _my_jar = File('www/my.jar')
>  > --cut-------------
>  >
>  > but that absolutely didn't work...
>
> And what happened?
>
>
> A few more questions (we need more context):
>
>   *  what is the "File" above. Where did you get it from?
>
>   *  usually, you should not simply return objects
>      but rather their content.
>
>      If "_my_jar" is really a "OFS.Image.File" object,
>      then you may succeed, as ZPublisher will convert
>      the object returned into a string, which
>      give the content for a "File" object.
>
>
> Dieter

--
Regards
Thomas Olsen

-------------------------------------------------------

-- 
Regards
Thomas Olsen