To store the name of the file in the database, are you using the clientFileName binding or the serverFileName binding? The serverFileName binding has the renamed file stored in it and the clientGileName has the completely capitalized extension stored in it.