Looking for a long time finally found a JSP can be used ... Share!!
Copy Code code as follows:
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "UTF-8"%>
<%@ taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<link rel= "stylesheet" href= ". /css/common.css "href=" Css/common.css "type=" Text/css "/>"
<title> Management Area </title>
<style type= "Text/css" ><!--
#newPreview
{
Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (Sizingmethod=scale);
}
--></style>
<script type= "Text/javascript" language= "JavaScript" ><!--
var flag=true;
function Previewimg (imgfile)
{
New preview code, support IE6, IE7,IE8 also support, Firefox does not support!! I tested the ...
var Newpreview = document.getElementById ("Newpreview");
NewPreview.filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). src = imgfile.value;
if (flag)
{
NewPreview.style.width = "100px";
NewPreview.style.height = "80px";
}
}
function Setimgwh ()
{
var Newpreview = document.getElementById ("Newpreview");
Flag=false;
NewPreview.style.width = document.getElementById ("Txtimgwidth"). value;;
NewPreview.style.height = document.getElementById ("Txtimgheight"). Value;
}
--></script>
<body>
<div id= "Man_zone" >
<form action= "product.do?command=addproduct" method= "post" name= "Upload" enctype= "Multipart/form-data" >
<table width= "100%" border= "0" align= "center" cellpadding= "3"
cellspacing= "1" class= "Table_style" >
<tr>
<TD class= "Left_title_2" >
Product Picture:
</td>
<td><input type= "File" name= "file" onchange= "javascript:previewimg (this);" Style= "border:1px #FFFFFF
Solid;background: #efefef "style=" border:1px #FFFFFF
Solid;background: #efefef "/><font color=red>*</font><div id=" Newpreview "></div></td >
</tr>
<tr>
<TD class= "Left_title_1" >
<input type= "Submit" name= "Submit" value= "Add"/>
</td>
<td>
<input type= "reset" name= "reset" value= "reset"/>
</td>
</tr>
</table>
</form>
</div>
</body>