2018-06-03 22:26:41 +08:00

65 lines
1.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ page contentType="text/html; charset=GBK"%><%@
include file="/IncludeBegin.jsp"%><%@
page import="com.amarsoft.are.jbo.*,com.amarsoft.biz.formatdoc.model.*" %>
<script>
function checkData(){
var obj = document.getElementById("fileField");
if(obj.value==''){
alert('请选择上传文件');
return false;
}
var iDot = obj.value.lastIndexOf(".");
if(iDot==-1){
alert('非法的文件结构');
return false;
}
//检查代码合法性
try{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile(obj.value);
if(f1.size>2048*1024){
alert("文件大于2048k不能上传");
return false;
}
}catch(e){
//alert(e.name+" "+e.number+" :"+e.message);
}
var sFileExt = obj.value.substring(iDot+1).toLowerCase();
if(sFileExt=='amardoc'){
return true;
}
else{
alert('仅支持如下文件格式amardoc');
return false;
}
}
</script>
<style>
body{
margin:10px;
}
table{
}
</style>
<body>
<form enctype="multipart/form-data" action="<%=sWebRootPath%>/AppConfig/FormatDoc/SaveUploadFile.jsp?CompClientID=<%=CurComp.getClientID()%>" name="form1" method="post" onSubmit="return checkData()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" align="center"><strong>上传格式化离线资料</strong></td>
</tr>
<tr>
<td colspan="2" align="left">选择上传文件:
<input type="file" name="fileField" id="fileField" /></td>
</tr>
<tr>
<td align="right"><input type="submit" name="button" id="button" value="提交" /></td>
<td><input type="button" name="close" id="close" value="关闭" onClick="window.close();"/>
</td>
</tr>
</table>
</form>
</body>
<%@ include file="/IncludeEnd.jsp"%>