[Zope] temporary document

Oliver Bleutgen myzope@gmx.net
Fri, 04 Apr 2003 17:26:00 +0200


Jerome Alet wrote:
> Hi there,
> 
> I'd want to be able to create a file object (PDF) in the ZODB, which 
> would be downloadable during say one hour or half an hour, and then 
> which would disappear automatically. 
> 
> Is it possible ? If yes then how ?

If you really want it in the zodb, you could use the "precondition" for 
a file object in order to compare ZopeTime() to 
bobobase_modification_time (or a special property you create for this 
task). If someone hits the file when
ZopeTime() > bobobase_modifcation_time + 2 hours, simply reply with a 
404 and delete the file.


HTH,
oliver