A Pen by Michael D Stemle Jr on CodePen.
Created
December 29, 2016 19:15
-
-
Save manchicken/e1ceb30500599a7995682b1d0354640d to your computer and use it in GitHub Desktop.
Inspecting Browser-Supplied MIME-Types
This file contains 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
<form method="post" enctype="multipart/form-data" id="form" onSubmit="return runIt();"> | |
<label for="fileInput">Select a File</label> | |
<input multiple="true" type="file" id="fileInput" name="fileInput" /> | |
<input type="submit" name="submit" value="Check!" /> | |
</form> |
This file contains 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
function runIt() { | |
console.log("HERE") | |
try { | |
alert("MIME-type: " + document.getElementById('fileInput').files[0].type); | |
} catch (err) { | |
console.error(err); | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment