Best way to replace imported file.

Afternoon,

I currently have documents coming from a scanner along with a xml file with the metadata that I import from a network path. These files are like a license in that the userID and type will always be the same, only the expire date will change.

What would be the best way to only keep one copy in MFiles. I was thinking about a some c# extension to first check if the user already has a older version of the license and delete it if found.

Is there a better\easier way? I have the compliance toolkit if that can help.

Thanks