Skip to content

Instantly share code, notes, and snippets.

@manchicken
Created December 29, 2016 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manchicken/e1ceb30500599a7995682b1d0354640d to your computer and use it in GitHub Desktop.
Save manchicken/e1ceb30500599a7995682b1d0354640d to your computer and use it in GitHub Desktop.
Inspecting Browser-Supplied MIME-Types
<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>
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