Check browser support for File api : File api is a feature of HTML5. File api is basically for doing some processing on the local files. User can get the files mime type or last modified date etc. User can also achieve the drag and drop file upload facility using the File api. File api is only supported by the browsers which supports the HTML5 , so most of the latest browsers support the File api.
Example of check the browser support of File api : In this example I will show you how we can check that our browser supports the new HTML5 File api or not.
App.html
<!DOCTYPE html>
<html>
<head>
<script>
if (window.File && window.FileReader && window.FileList && window.Blob) {
alert('File API supported.!');
} else {
alert('The File API not supported by this browser.');
}
</script>
</head>
<body>
</body>
</html>
So when you run this html file on the browser it will give a pop up with the message that the browser supports File api or not.
0 Comment(s)