<form method="post" id="imgForm" action ="/hi/holdHead" enctype="multipart/form-data">
<input type="hidden" id="householdId_img" name="householdId_img"/>
<img src='viewimgshangchuan1.png' alt='' id='img' width="126px" />
<input type='file' id='iptfileupload' name="photoFilePic" />
</form>
//file按钮隐藏
$(function(){
$("#iptfileupload").hide();
$("#img").click(function(){
$("#iptfileupload").trigger("click");
});
//input file
$("#iptfileupload").change(function(event){
var file = event.target.files[0];
var reader = new FileReader();
reader.onload = function(e){
//要显示的图片
$("#img").attr("src",e.target.result);
}
reader.readAsDataURL(file);
});