|
Posted by techusky on 08/05/07 03:31
On Aug 4, 8:04 pm, Matt Madrid <admiral...@gmail.com> wrote:
> techu...@gmail.com wrote:
> > I made a script that successfully creates a .zip file of all the files
> > in a directory on my web server, but now what I haven't figured out
> > how to do is how to have it automatically deleted when the user
> > successfully downloads it, as otherwise my server would eventually get
> > clogged up with all these zip files.
>
> > Any help/suggestions?
>
> > Thanks
>
> I'd probably just create a cron job that deletes any zip files older than
> a day. That's the simplest way I can think of. Of course, depending on the
> amount of disk space you have available, and how trustworthy your users are,
> this could open you up to a DOS attack of sorts. A person could keep clicking
> on the download link (or automate it) and possibly fill up your whole disk in
> a day.
I had a thought during dinner, but I'm not sure if this would
*actually* work or not:
Could I initiate a session when a user navigates to a folder, and when
they leave that particular folder destroy the session which I could
then trigger using a simple if-statement to delete the .zip file?
[Back to original message]
|