Cannot get MulitiFile upload and Validation to work
I am looking for a validation expression sample when using multi-file upload.
I simply dropped onto a blank web form a multi upload control. This WORKS JUST fine. If I add a validation control (RegularExpressionValidator) to the screen then all uploads are prevented (due to validation fail).
I using this expression for the validate:
The above works fine if I place a regular text box on the form and cut+paste in the file name to this regular text box. Not 100% sure, but I believe multi-file upload passes the whole path name string to validation?
So above does allow ":" and "\" so thus c:\somefilename.pdf ALSO passes validation of a standard text box. So we do have a working validation here.
Is just each single file name passed to validation?
Or is ALL FILE names passed as a SINGLE STRING separated by some delimiter to the validation expression?
Does anyone have a suggested validation expression that will work?
I am open to the idea of adding some jscript code to validate the file(s) selected if this is possible when using the multiple file upload.
I am NOT use the flash option to allow multiple files to be selected on one try but validation FAILS EVEN when only selecting one file anyway.
As noted the multiple file upload control works 100% fine and ALLOWS multiple file upload. Adding the progress bar to the form ALSO WORKS just fine.
The instant I add a validation control to the form then I am unable to validate using the above or in fact ANY expression except those that allow every possible string.
Using Vs2010 + vb.net
I am thrilled and much grateful for those here who shared this code. And it rather amazing how well this upload library works.
Unfortunately this validation issue is now costing me far more time than expected and as an result is creating a very bad experience for me.
Again, grateful to anyone who has a suggestions or pointing me in a another direction that will yield fruit.
Albert D. Kallal (Microsoft MVP)
Edmonton, Alberta Canada