做个参考
<script language=javascript>
function check()
{
var file1=document.getElementById("f1");
var img1=document.getElementById("i1");
img1.src=file1.value;
}
</script>
<input type=file name="f1" id="f1" onpropertychange="check();">
<img name="i1" id="i1" src="">