Is there a way to test if a given browser supports the multiple attribute on file upload elements? Either a server-side or client-side implementation is sufficient.
I do realize I can test the user-agent against a list of known browsers that support the feature, but that seems like a rather frail implementation (ie. if IE 10 supports the feature when it finally launches, the I'll have to go edit back my code). I'd prefer to test support of the feature directly.
Thoughts?
I'd recommend using "multiple" in document.createElement("input") for feature detection.
Since this functionality is part of the HTML5 specification and is only just emerging in current implementations, you may not yet have a definitive and reliable way to do this. Want to know for sure? Then test it on as many browsers as possible. However, with that said, the code segment found at:
https://developer.mozilla.org/en/DOM/Input.multiple
does show that you should be able to determine this based on a simple test for the existence of the "multiple" attribute like is commonly used in many other elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With