You can create a comma separated string of mime types you want to support (below one is for xls, xlsx etc )
String mimeList = "application/vnd.ms-excel,application/msexcel,application/"
+ "x-msexcel,application/x-ms-excel,application/vnd.ms-excel,application/"
+ "x-excel,application/x-dos_ms_excel,application/xls,application/"
+ "vnd.openxmlformats-officedocument.spreadsheetml.sheet";
myFileUploader.setAcceptedTypes(mimeList);
Please note that there's no guarantee that this will work in all
browsers.
I have tested with Google chrome only and it works!
The W3C spec says only that this "provides the user agent
with a hint of file types to accept". How it does that is up to the
browser, and the browser is free to give the user the option to select
any file, notwithstanding your list of acceptable MIME types. So
you're still going to want to validate the file when the user clicks
the submit button or at the server side.