You can have a cron job, or something like it, that keeps an inventory of all the uploaded files, and the date each got added, in some form of database — say, a flat file. If you run it once a day, you can't be wrong more than a day. An extra signature check, using
Digest::MD5 for example, can store a fingerprint of the file, so you can see if the file contents haven't changed since it got added. You might use this as a signal to reset the age counter, for this file.