- create a db table to keep track of files in the folder
- create a script that compares folder contents with that db table
- if files found which aren’t in the table, sanitize content and insert into db, and add filename to tracking table
- if a file in table is no longer in folder, remove that file’s content from db and remove from tracking table
- set script to run via cron so that it checks folder at the interval you specify
hope this helps point you in the right direction 🙂