can anyone tell me about how to control image selection event. For example like I want my program to only select .jpg
and .png
format and for rest, at the time of selection it will show an error message.
Asked
Active
Viewed 40 times
0

The Hungry Dictator
- 3,444
- 5
- 37
- 53
-
dup? [trigger file upload event ](http://stackoverflow.com/questions/30021335/trigger-file-upload-event) – Lei Yang May 16 '17 at 06:25
-
@LeiYang not getting properly – May 16 '17 at 06:28
-
1Pls post your model and how you use in view? – User3250 May 16 '17 at 06:28
-
which part not? – Lei Yang May 16 '17 at 06:28
-
@LeiYang Question isn't a duplicate of other link you provided pls recheck – User3250 May 16 '17 at 06:29
-
@LeiYang actually i have an upload button and at the time of image selection i just want to have like i only want to select only jpg and png image and for rest it will show an error – May 16 '17 at 06:33
-
Check [data annotation](http://stackoverflow.com/questions/40199870/how-to-validate-file-type-of-httppostedfilebase-attribute-in-asp-net-mvc-4) and [client side](http://stackoverflow.com/questions/71944/how-do-i-validate-the-file-type-of-a-file-upload) – User3250 May 16 '17 at 06:41