java的Apache文件上传的HTML文件(接上版的java上传代码)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>添加资源共享</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="添加资源共享">
<meta http-equiv="description" content="添加资源共享">
<script language="JavaScript">
function checkfm(form){
var uploadfile = form.uploadfile.value;
if(uploadfile!=""){
var types = ["jpg","gif","bmp","png","exe","doc","pdf","txt","xls","ppt","swf","rar"];
var ext = uploadfile.substring(uploadfile.length-3).toLowerCase();
var sing = false;
for(var i=0; i<types.length;i++){
if (ext==types[i]){
sing = true;
}
}
if(!sing){
alert("只允许上传图片/flash动画/word文件/exe文件/pdf文件/TxT文件/xls文件/ppt文件/rar文件");
return false;
}
}
//window.close();
return true;
}
//判断成功与否
function onloads(){
var isok='<%=isSuccess%>';
if(isok=='success'){
alert("上传文件成功!");
doclose();
}
if(isok=='sizeerror'){
alert("文件上传失败,大小不能超过4MB!");
}
if(isok=='fail'){
alert("上传文件失败!");
}
}
//关闭本窗口
function doclose(){
window.close();
try{
window.opener.window.refresh_article(); //firefox
}catch(e){
window.dialogArguments.refresh_article(); //ie8
}
}
</script>
</head>
<body style="text-align: center; " οnlοad="onloads();">
<form name="myform" action="qyqz/resourcesharing_action.jsp" method="post"
enctype="multipart/form-data" οnsubmit="return checkfm(this)" >
<input type="hidden" name="groupid" value='<%=groupid%>'>
请选择本地资源共享的文件名称:<br>
<input type="file" name="uploadfile"><br>
<input type="submit" name="submit" value="上传" />
<input type="button" value="取消上传" οnclick="javacript:window.close();" />
</form>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值