home · blog · groups · about us · contact us
DevelopmentNow Blog
 Friday, August 08, 2008
 
 

One of our clients today noted an issue where a RegularExpressionValidator for a FileUpload control was failing in FireFox 3.0.1 only. My guess is that version 3.0.1 was doing something new with the filename when posting to the server. Or something.

Anyhow, the "fix" I came up with was to set EnableClientScript to false, and instead of using a validation expression like this

"^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF)$"

changed the validator to use something like this

"^.+\.((jpg)|(gif)|(jpeg)|(png)|(bmp))$"

and then ensured that I'm checking the file's existence in the codebehind.

Thanks to Wen Ching's blog post for the regex idea.

August 8, 2008    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]

Related posts:
iPhone Webapp Development for ASP.NET
Parse CSV Files in C# and ASP.NET
Visual Studio 2008 Virtual PC Performance Tips
Linq to SQL: Cast Stored Procedure Results to Table Entities
Grouping in Linq to SQL vs SQL
LinqDataSource doesn't load child tables


« Parse CSV Files in C# and ASP.NET | Main | jQuery Plugin Overload »