Last active
December 19, 2015 04:39
-
-
Save ahsquared/5898528 to your computer and use it in GitHub Desktop.
File upload support on mobile
from: http://viljamis.com/blog/2012/file-upload-support-on-mobile/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST RESULTS | |
OS Supported? | |
Android 1.0—2.1 No | |
Android 2.2+ Yes | |
Blackberry 1.0—5.0 No | |
Blackberry 6.0+ Yes | |
BB Tablet OS 2.0+ Yes | |
Firefox OS 1.0 No | |
iOS 1.0—5.1.1 No | |
iOS 6.0+ Yes | |
Kindle OS 1.0—3.0 No | |
Maemo 5.0+ Yes | |
Meego 1.2+ Yes | |
Symbian 9.1-10.1 Yes | |
WebOS 1.0—3.0.5 No | |
Windows Phone 7.0—8.0 No | |
Windows RT Yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Detect input type=file support | |
var isFileInputSupported = (function () { | |
// Handle devices which falsely report support | |
if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) { | |
return false; | |
} | |
// Create test element | |
var el = document.createElement("input"); | |
el.type = "file"; | |
return !el.disabled; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment