客户端上传图片到服务器时,选择了客户端的图片,怎么把图片显示出来?
3x

解决方案 »

  1.   

    试试:
    <html>
    <head>
    <title>取图片尺寸</title>
    </head>
    <body>
    图像地址
    <input name="i" type="file" onchange="img.src=this.value" size="70">
    <br/>
    高<input type="text" name="h"><br/>
    宽<input type="text" name="w"><br/>
    大小<input type="text" name="s"><br/>
    <br/>
    <br/>
    <br/><div style="position:absolute;top:;left:0;visibility:">
    <img id="img" onload="Show(this)">
    </div><script language="JavaScript">
    function Show(oImg)
    {
         document.all.h.value=oImg.height;
         document.all.w.value=oImg.width;
    document.all.s.value=oImg.fileSize;
    }
    </script>
    </body>
    </html>