从网上下载一个SmartUpload的控件可以使用。
解决方案 »
- 急!!!!(求懂得工作流引擎的大哥指点【jBPM4.4】)求大侠指点,请问这是什么错误,在线等...
- 关于Struts2跳转的问题
- 做了一个简单的struts2的项目,就一个登录action,提示action找不到,请各位大侠帮忙看看,谢了!
- tomcat启动后index.jsp全是代码怎么办啊?
- 写一个通用的webservice客户端处理程序
- jsp与flash,powerpoint相结合的问题
- strut2 拦截器和校验框架有什么关系。。。。。。
- 皮肤样式选择更换问题。。重谢
- javamail发送邮件问题
- 如何编译含servlet类的*.java 文件
- 关于权限系统退出时清空session的问题
- 锋网新闻发布提供下载^^(提意见的均给分)
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>ϵͳά»¤</title>
</head><script LANGUAGE="javascript">
function my_ok() {
var str = form1.filename.value; if (str=='')
{
alert("ÇëÑ¡ÔñÒ»ÌõÎļþ");
form1.filename.focus();
return false;
}
form1.submit(); }
</script>
<body><h1 align="center"><font color="#FF00FF">ÉÏ´«Îļþ</font></h1>
<hr>
<form id=form1 ENCTYPE="multipart/form-data" action="upload.jsp" method="POST"> <table border="1" width="85%" height="57">
<tr>
<td width="10%" height="25">²¿ ÃÅ</td>
<td width="90%" height="25"><input type="text" name="dept" size="65"></td>
</tr>
<tr>
<td width="10%" height="25">²Ù×÷Õß</td>
<td width="90%" height="25"><input type="text" name="actor" size="65"></td>
</tr>
<tr>
<td width="10%" height="25">±ê Ìâ</td>
<td width="90%" height="25"><input type="text" name="title" size="65"></td>
</tr>
<tr>
<td width="10%" height="25">ÎļþÃû</td>
<td width="90%" height="25"><input type="file" name="filename" size="65"></td>
</tr>
<tr>
<td width="10%" height="25">À¸ Ä¿</td>
<td width="90%" height="25"><select size="1" name="item">
<option>Áìµ¼»î¶¯</option>
<option>»áÒé°²ÅÅ</option>
<option>֪ͨ¹«¸æ</option>
</select></td>
</tr>
</table>
<p><input type="button" value="Ìá½»" name="B1" onClick="javascript:my_ok();"><input type="reset" value="È«²¿ÖØд" name="B2"></p>
</form></body></html>JSP文件
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="com.jspsmart.upload.*"%>
<%@ page import="database.mssql_bean"%>
<%@ page import="java.sql.*"%> <% SmartUpload mySmartUpload = new SmartUpload(); int count=0;
mySmartUpload.initialize(pageContext); //³õʼ»¯
mySmartUpload.setTotalMaxFileSize(5000000); //Îļþ×î´ó³ß´ç5M
mySmartUpload.upload(); //ÉÏ´«
String filename = mySmartUpload.getFiles().getFile(0).getFileName();
String dept = mySmartUpload.getRequest().getParameter("dept");
String actor = mySmartUpload.getRequest().getParameter("actor");
String title = mySmartUpload.getRequest().getParameter("title");
String item = mySmartUpload.getRequest().getParameter("item");
String sql = "insert into doc(item,title,time,dept,actor,filename) select (select item from itemlist where descr='"+item+"'),'"+title+"',"+"getdate(),'"+dept+"','"+actor+"','doc/"+filename+"'";
mssql_bean mb = new mssql_bean();
String temp = null;
temp = mb.getconn();
temp = mb.modify(sql);
mb.close();
try {
count = mySmartUpload.save("/upload"); //´æÅÌ
%>
<script LANGUAGE="javascript">
alert ("ÉÏ´«³É¹¦!");
</script>
<%
}
catch (Exception e)
{
%>
<script LANGUAGE="javascript">
alert ("ÉÏ´«Ê§°Ü,ÇëÔÙÊÔÒ»´Î!");
window.location="upload.htm";
</script>
<%
}
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><script>
function ex() {
window.location="upload.htm";
}
</script><body><h1 align="center"><font color="#FF00FF">ÉÏ´«Îļþ½á¹û</font></h1>
<hr>
<form id=form1 method="post" action="upload.htm"> <table border="1" width="85%" height="57">
<tr>
<td width="10%" height="25">²¿ ÃÅ</td>
<td width="90%" height="25"><%=dept%></td>
</tr>
<tr>
<td width="10%" height="25">²Ù×÷Õß</td>
<td width="90%" height="25"><%=actor%></td>
</tr>
<tr>
<td width="10%" height="25">±ê Ìâ</td>
<td width="90%" height="25"><%=title%></td>
</tr>
<tr>
<td width="10%" height="25">ÎļþÃû</td>
<td width="90%" height="25"><%=filename%></td>
</tr>
<tr>
<td width="10%" height="25">À¸ Ä¿</td>
<td width="90%" height="25"><%=item%></td>
</tr>
</table>
<p align="center"><input type="submit" value="·µ »Ø" name="B1"></p>
</form></body></html>
http://expert.csdn.net/Expert/topic/1654/1654590.xml?temp=.3409845