You are validating a row from a recordset in this code. You should be validating the name of the file uploaded. You should be able to get the file name or even the file extension from the bindings panel and use that to do your validation.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.