Add method to check for duplicate files in the database.