< SCRIPT LANGUAGE ="JavaScript" > ... <!--function DrawImage(ImgD,ImgWidth,ImgHeight)...{ var image=new Image(); image.src=ImgD.src; if(ImgWidth<=0)ImgWidth=image.width; if(ImgHeight<=0)ImgHeight=image.height; if(image.width>ImgWidth || image.height>ImgHeight)...{ if(image.width/image.height<ImgWidth/ImgHeight)...{ ImgD.width=(image.width*ImgHeight)/image.height; ImgD.height=ImgHeight; }else...{ ImgD.height=(image.height*ImgWidth)/image.width; ImgD.width=ImgWidth; } }}function LoadPreviewImage(path)...{ document.all.ImagePreview.innerHTML = "<img border=0 οnlοad=DrawImage(this,300,300) src='"+path+"' >";}//--> </ SCRIPT > < input type ="file" onchange ="LoadPreviewImage(this.value);" > < DIV id ="ImagePreview" > </ DIV > 貌似不支持FireFox,IE7;有解决方案请补充.......