使用JSP/Servlet上载文件-网站制作-编程文档-人才家园--中国人才库
您所在的位置:中国人才库--人才家园--编程文档--网站制作
使用JSP/Servlet上载文件
来源: 编辑:duliying 更新日期:2008-6-14 17:04:40 浏览:354 次
使用 JSP/ Servlet上载文件正成为一项常用的任务。以下是一个简单的例程,使用了jspsmart的一个免费的组件。你可以在JSPSMART站点进行下载。 1. Html File
<html>
<body>
<script LANGUAGE="javascript" SRC="JSFunction.js">
</script>
<script language="JavaScript">
<!--
function checkForm(){ if (document.uploadform.adsImage.value==""){
alert("You must choose what image file to upload!");
return false;
}
document.uploadform.submit();
}
function cancelUpload(){
window.close();
window.opener.focus();
}
//-->
</script>
<form name="uploadform" method="post"
action="uploadImage.jsp" ENCTYPE="multipart/form-data"
target=_self>
<center>
<table border="1" width="65%">
<tr>
<td colspan=2 nowrap align=center>广告图片上载</td> </tr>
<tr>
<td width="15%" nowrap >广告图片:</td>
<td width="50%" nowrap><input type="file"
name="adsImage" size="20"></td>
</tr>
<tr>
<td align="center" colspan=2 >
<input type="button" value="upload" onclick="return
checkForm();" >
&nbsp;&nbsp;&nbsp;
<input type="butt
 第1页/总3页  第一页 上一页 下一页 最后一页     【发表评论】
昵   称:  (不填写则显示为匿名)
标   题:
内   容:
 
免责声明:网友对此资源信息的评论仅代表个人观点,中国人才库有权删除违乱评论信息!
石家庄广通印刷学校