Skip to content

Instantly share code, notes, and snippets.

@jaemar
Created February 25, 2014 07:34
Show Gist options
  • Save jaemar/9204511 to your computer and use it in GitHub Desktop.
Save jaemar/9204511 to your computer and use it in GitHub Desktop.
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#previewHolder').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#filePhoto").change(function() {
readURL(this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment