[Zope-CMF] Temporary Files with multiple upload
Tue, 27 May 2003 21:30:51 +0200
Pascal Samuzeau wrote at 2003-5-27 16:26 +0100:
> I want let my members to upload files, as much as they want.
> To do this, I upload directly the files on the disk.
> My problem appear when someone upload one or more files, and after run
> away, just before to confirm the finish work.
> Of course many files standalone on my server.
> I thought used the TemporaryFile, but I have still a problem.
> One of this is if somebody is uploading the second file, I have lost
> the first one (of course).
> How to avoid it?
> What is the way to simulate the temporary file, to be sure to not have
> a disk full after some upload not validate?
You want objects to disappear magically when the upload is not confirmed.
Of course, there is no such magic out of the box.
What you can do (for example):
Put your uploaded files in a temporary folder.
Move them somewhere else when the upload is confirmed.
Clean the temporary folder from time to time removing
There are several variations on this scheme.
In all cases, you must do something for confirmed uploads
and periodically clean up.