/    Sign up×
Community /Pin to ProfileBookmark

Delete files based on a time stamp

I have a folder I copy files on to my server. Customers then login and download the files. I would like the files to delete after 48 hours once I place them on the server with out me going back manually and deleteing them.

Does anyone know a script that will gather the stamp of the file and then delete if accordingly?

Thank you!

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Phill_PaffordAug 25.2008 — You could run a script as a cron job to take care of this.

use the filemtime()

http://us.php.net/manual/en/function.filemtime.php
Copy linkTweet thisAlerts:
@Mr__E__CrypticAug 25.2008 — Just curious; is this one of those non-tangible stores where you're copying the original file when someone purchases it?
Copy linkTweet thisAlerts:
@bneitschauthorAug 25.2008 — Just customer files that I give them to download when they request and I dont want them hanging around on the server and I don't want to baby sit the folder either.
×

Success!

Help @bneitsch spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...