1

Client is receiving extensions from server.so at client side, we have the extensions of the files, which i want to pass it to FileUpload so that on browse it will show only files with specific extensions. Currently i have below code:

 fileUpload.getElement().setPropertyString( "accept", ".xslx" );

And i have also tried with

fileUpload.getElement().setAttribute( "accept",  ".xslx"  );

In both the above cases on browse(on opening windows for file selection) it show "All Files" by default and also there is no other opetion coming into file type selection drop down box other than "All Files". Please suggest solution to this.

NOTE:I only have the extensions of the files and DON'T have MIME type. one solution can be getting MIME types from extension but again these classes in java for getting MIME types from extension are not working with GWT.

I have referred question [Can I specify a file type in GWT FileUpload?

this one is not duplicate of that.

Community
  • 1
  • 1
Ganesh
  • 103
  • 10

0 Answers0