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 ? I've tried to create it in the temporary folder at ZODB's root, but it doesn't disappear (maybe I've done something wrong) I've searched the archives on zope.nipltd.com but without finding what I want. thanks in advance. Jerome Alet
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
On Fri, Apr 04, 2003 at 05:26:00PM +0200, Oliver Bleutgen wrote:
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.
OK, but if nobody tries to download it, the file stays in my ZODB... And that's what I wanted to avoid. OK, I'll probably code some cron job of some sort... Thanks anyway Jerome Alet
Jerome Alet wrote at 2003-4-4 17:00 +0200:
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 ?
You could try the "TemporaryFolder" (usually used for sessions"). Dieter
participants (3)
-
Dieter Maurer -
Jerome Alet -
Oliver Bleutgen