Posted by Matt Madrid on 08/05/07 03:04
techusky@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.
[Back to original message]
|