Skip to content

Instantly share code, notes, and snippets.

@stgoos
Forked from jacobtwlee/UploadSupportDetection.js
Created January 15, 2017 15:11
Show Gist options
  • Save stgoos/498992f27597a02ab73650eceee76f62 to your computer and use it in GitHub Desktop.
Save stgoos/498992f27597a02ab73650eceee76f62 to your computer and use it in GitHub Desktop.
Upload support detection
function isUploadSupported() {
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;
}
var elem = document.createElement('input');
elem.type = 'file';
return !elem.disabled;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment