Scans folders and records files in a database