[Zope] Stuffing file objects into my objects

Damon Eckhoff eckhoffd@missouri.edu
Fri, 14 Jun 2002 10:08:02 -0500

On 6/13/02 2:07 PM, "Dieter Maurer" <dieter@handshake.de> wrote:

> The easiest solution is to use an attribute for your file object, say "file".
> Then, you can simply use "<url_to_your_instance>/file".
> The next easiest solution is a method "viewFile" that uses
> "getFile" to locate the file object and then calls its
> "index_html".

Dieter, I appreciate the help...

Okay, I created the viewFile method:

    def viewFile( self, REQUEST=None ):
        "Views the file"
        self._file.index_html( REQUEST, REQUEST.RESPONSE)

So, when I access it via /instance/viewFile, the precondition does
get called, but the browser just sits and spins never to display the file
or prompt for a download.  Am I not passing the correct response object in?
>From the looks of Image.File.index_html, it should handle everything, right?

Also, to clarify, is there anything special that I have to do to
make the object an attribute.  Right now it is stored in <instance>._file.

Again, I appreciate the help as I wade through all this.