Skip to content

Instantly share code, notes, and snippets.

@code-for-coffee
Created May 30, 2015 17:06
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 code-for-coffee/4800f8e04cbed3e80108 to your computer and use it in GitHub Desktop.
Save code-for-coffee/4800f8e04cbed3e80108 to your computer and use it in GitHub Desktop.
FileReader Upload
<script type="text/javascript">
$(document).ready(function(event) {
// select our input DOM element with a type of file
var fileInput = $('input[type="file"]')[0];
// select our form, too
var form = $('form')[0];
// prevent our form from submitting via POSTBACK
$(form).on('submit', function(event) {
event.preventDefault();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment