File expiry in directory

Hello,

I recently bought a webcam that I configured to upload images to a FTP directly. However as my coding skills are limited to HTML and CSS I am unsure of how I can use PHP to automatically delete files of a specific format (.sfpg, .jpg) older than a specified period (e.g. 14 days) in my FTP file directory.

Would appreciate some help, and thanks in advance! ;D

look up glob(), file() and unlink() on php.net, there’s some good examples of how to look at a folder, then use file and unlink to delete the files. you’ll need to do it with a cronjob though since you want it automatically. that can be done through cpanel though.

Sponsor our Newsletter | Privacy Policy | Terms of Service