My Zope site generates many reports in PDF format, and stores them in a
folder that's only accessible to customers via a password-protected form.
I currently store each report's password as a property of its File object.

My problem is that I'm creating several hundred megabyte-sized file
objects in my ZODB each day, and even though I expire them after five
days the performance hit when storing and fetching the files is painful.

I think, then, that I should be looking at an external filesystem store.
LocalFS looks very nice, but it doesn't seem to support properties (which
I currently need).  ExtFile looks very nice and does support properties,
and that's the way I'm heading.  Does that seem reasonable given my usage?

Also, I'm currently inserting the file uploads into a folder named
"files" (ain't I creative?) with this method call:

    context.files.manage_addFile(id=filename, file=filecontents, 
content_type=filetype)

I tried what I thought would be the ExtFile equivalent:

    context.files.manage_addProduct['ExtFile'].manage_addExtFile(id=filename, 
file=filecontents, content_type=filetype)

but that only dumps the contents of the file to the client and doesn't
actually store that data.  Clients see a long page of gibberish like:

    Shipment Search | View Selected Images 
    %PDF-1.2 %âãÏÓ 1 0 obj << /Type /Catalog /Pages 3 0 R >> endobj 2 0 obj << 
/CreationDate (D:20060410110742) /ModDate (D:20060410110742) /Producer (libtiff 
/ tiff2pdf - 20060313 / d) >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 9 0 
R ] /Count 2 >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /MediaBox [0.0000 
0.0000 608.2560 792.0000] /Contents 5 0 R /Resources << /XObject << /Im1 7 0 R 
>> /ProcSet [ /ImageB ] >> >> endobj 5 0 obj << /Length 6 0 R >> stream q 
608.2560 0.0000 0.0000 792.0000 0.0000 0.0000 cm /Im1 Do Q endstream endobj 6 0 
obj 62 endobj 7 0 obj << /Length 8 0 R /Type /XObject /Subtype

In other words, the normal page header, plus the raw data.  I'm not sure
why that's happening.
-- 
Kirk Strauser
The Day Companies
_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to