[SOLVED] Preventing "orphaned" files - How would you handle it?

I think this would be the solution,