<input id="file1" name="filename" type="file" />
<img id="img1" src="" style="width:200px;height:160px;">
<script language="javascript">
$(function(){
$("#file1").on("change",function(){
var file=this.files[0];
if(this.files && file){
var reader=new FileReader();
reader.οnlοad=function(e){
$("#img1").attr("src",e.target.result);
}
reader.readAsDataURL(file);
}
});
});
</script>