Example demonstrates how to check type of selected files using Java Script function.
Code checks files on client side before they are uploaded.
You can allow to upload only files with specifed extentions or to prohibit files with specifed extentions.
If Java Scripts disabled or file name is hidden (Opera 5) example posts Form without files checking!
Select only *.jpg, *.jpeg, *.gif, or *.bmp file:  
Select any file except *.exe, *.com or *.bat file:  

Other examples