Seam <s:fileUpload> component shows all files, not only the file types set in the 'accept' attribute.
Environment
- JBoss Enterprise Application Platform (EAP) 5.1.0
- Seam 2
Issue
- Seam <s:fileUpload> component shows all files, not only the file types set in the 'accept' attribute.
Resolution
According to Seam Reference Guide [1], the 'accept' attribute 'may not be supported by the browser'. That check to reject a file before uploading the content, if it does not match the appropriate content type, is left to the browser. Unfortunately, none of the browsers support this attribute. This is not a Seam issue. It's a browser feature, an attribute of the HTML input form, that is not supported by any of the browsers.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
