Asheeown Posted November 18, 2007 Share Posted November 18, 2007 I am creating a program that is going to make a file populated with at least 20 MB of data and many people are going to be using it. I want the user to be able to download this file for at least 10 minutes and then it to be deleted. Does this have to be done via cronjob or can php write a rule to delete that file after 10 minutes? Because if this was done by cronjob it would have to be set basically to run every minute to get it right on the dot like most website do. Quote Link to comment https://forums.phpfreaks.com/topic/77871-solved-file-creation-and-temp-download-time/ Share on other sites More sharing options...
MadTechie Posted November 18, 2007 Share Posted November 18, 2007 have a database with a table + timestamp, when the timestamp+10minutes expires you can refuse the downloads.. you can then have a cleanup script / cronjob to delete expired files every hour/day/week whatever EDIT: you could replace the database table with a flatfile Quote Link to comment https://forums.phpfreaks.com/topic/77871-solved-file-creation-and-temp-download-time/#findComment-394138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.