Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File Upload with RegularExpressionValidator not working with Firefox only IE

I have a FileUpload with a RegularExpressionValidator with the following Validation Expression:

^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.gif|.jpg|.JPG|.JPEG|.GIF|.jpeg|.png|.bmp|.3dm|.3dmf|.ai|.drw|.dxf|.esp|.mng|.png|.ps|.psp|.svg|.tiff)$

This way I make sure the User only upload images. But for some reason it does not work when I use Firefox. Why is that and how can I go around the problem?

like image 427
Etienne Avatar asked May 01 '09 07:05

Etienne


2 Answers

Try this:

(.*?)\.(jpg|jpeg|png|gif)$
like image 123
Iralda Mitro Avatar answered Oct 15 '22 12:10

Iralda Mitro


An enhancement to DaDa's solution that caters for case-sensitivity:

^(.*?)\.(((j|J)(p|P)(e|E)?(g|G))|((p|P)(n|N)(g|G))|((g|G)(i|I)(f|F)))$
like image 43
Ed Graham Avatar answered Oct 15 '22 12:10

Ed Graham