[Zope] Re: [Zope-dev] RE: ZDiscussions

Stephan Richter srichter@cbu.edu
Tue, 21 Mar 2000 08:28:06 -0600


>Q. How do you add a file to a Zope object?
>
>A. Make the object folder-like and drop a File object in there.
>This way you can make it an Image instead if you wish, or any
>other Zope object your heart feels like enabling (if you
>subclass ObjectManager instead of Folder, you can choose which
>classes of sub-objects are acceptable) and support more than
>one attachment easily.

Well, I don't think that is the optimum solution, especially for big sites. 
Even though that is the Zope way of doing things, I hate the idea that I 
clutter my ZODB with files. I would suggest you add a property called 
attachments to your Class which points to various URLs and then serve the 
files via Apache. You may want to use PCGI to do this.
We just switched to PCGI and now we serve Images and Documents from another 
port via Apache (we can also use SSL now). That helps to keep the I/O 
stream to the ZODB file moderate. Remember, ZODB is just big one file (even 
though Zope does a lot of caching). You could also check into LocalFS, 
which is nice in some cases (even though we were unsuccessful to upload 
files, using it.)

Regards,
Stephan
--
Stephan Richter - (901) 573-3308 - srichter@cbu.edu
CBU - Physics & Chemistry; Framework Web - Web Design & Development
PGP Key: 735E C61E 5C64 F430 4F9C 798E DCA2 07E3 E42B 5391