<%@ page contentType="text/html;charset=gb2312" %>
<%String type=request.getParameter("type");%>
<style type="text/css">
<!--
.td1 {
}
.td{
}
INPUT {
}
.input{
-->
</style>
<script>
var sz;
var img=null;
var IsCheck;
function check()
{
IsCheck=1;
if(img)img.removeNode(true);
img=document.createElement("img");
img.style.position="absolute";
img.style.visibility="hidden";
img.attachEvent("onerror",oErr);
document.body.insertAdjacentElement("beforeend",img);
if(IsCheck==0){window.location.href='upload.jsp?type=<%=type%>';return false;}
img.src=Myform.Submit.value;
if(IsCheck==1){return true;}
}
function oErr()
{
IsCheck=0;
alert("不能加载图片!请确认文件正确 JPG GIF");
window.location.href='upload.jsp?type=<%=type%>';
}
function on(){
if(document.all.Submit.value==""){
document.all.Submit.focus();
window.location.href='upload.jsp?type=<%=type%>';
return false;
}
if(sz==-1){getpize();}
if(sz>212992){
alert("图片大小不大于200KB");
window.location.href='upload.jsp?type=<%=type%>';
return false;
}else{
if(check()){
if(IsCheck==0){window.location.href='upload.jsp?type=<%=type%>';}
document.all.Myform.submit();
}
}
}
function getpize(){
sz=img.fileSize;
}</script>
<style type="text/css">
<!--
body {
}
-->
</style>
<form action="Unload.jsp?tye=<%=type%>" method="post" enctype="multipart/form-data" name="Myform">
<input name="Submit" type="file" value="提交" onChange="getpize()" class="input">
<input name="Submit2" type="button" class="btn_grey"
</form>