Skip to content

Instantly share code, notes, and snippets.

@tayfunerbilen
Created September 11, 2013 01:16
Show Gist options
  • Save tayfunerbilen/6518165 to your computer and use it in GitHub Desktop.
Save tayfunerbilen/6518165 to your computer and use it in GitHub Desktop.
FileReader example #1
$('input[name=fotograf]').change(function(e){
if (window.File && window.FileReader && window.FileList && window.Blob) {
var fotograf = e.target.files[0];
var reader = new FileReader();
reader.readAsDataURL(fotograf);
reader.onload = function(evt){
$('#result').attr('src', evt.target.result);
}
} else {
alert('Tarayıcınızın önizleme desteği bulunmuyor.');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment