commonfileupload
来源:互联网 发布:聚合数据是个啥网站 编辑:程序博客网 时间:2024/05/03 21:18
fileup.jsp showKid 图片类别bean DBconn 连接数据库
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*" errorPage="" %>
<jsp:useBean id="show" scope="page" class="test.showKid"/>
<jsp:useBean id="test" scope="page" class="test.DBconn"/>
<html>
<head>
<title>MMS图片上传</title>
<%@ include file="page.css"%>
</head>
<body>
<center>
<table width="500" height="500">
<form action="fileup_in.jsp" method="post" enctype="multipart/form-data" name="form1">
<tr>
<th height="30" colspan="3">MMS图片上传</th>
</tr>
<tr>
<td height="20" colspan="3">
图片路径:<input name="thisfile" type="file" id="thisfile">
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片类别:<%=show.showKid()%>
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片说明:<input type="text" class="pp" name="name" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
下载次数:<input type="text" class="pp" name="down" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片排序:<input type="text" class="pp" name="seqno" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
<input type="submit" name="Submit" value="确 定">
</td>
</tr>
</form>
<tr>
<td colspan="3" height="30">
</td>
</tr>
<%
int pid = show.getTop();
int i = 0;
Object tmpid;
Object pixid;
Object pic_url;
ArrayList al = new ArrayList();
try {
String sql = "select pid,pixid,pic_url from picturelib where pid="+pid+"";
ResultSet rs = test.executeQuery(sql);
while (rs.next())
{
tmpid = rs.getString(1);
pixid = rs.getString(2);
pic_url = rs.getString(3);
al.add(0,tmpid);
al.add(1,pixid);
al.add(2,pic_url);
i++;
}
}
catch(Exception e)
{
System.out.println("sql error");
}
file://System.out.println(al.size());
%>
<form action="fileup2_in.jsp" method="post" enctype="multipart/form-data" name="form1">
<tr>
<td width="351" height="60">
<input type="hidden" name="id" value="<%=pid%>">
30 X 30px: <input type="hidden" name="pixid" value="1"><input name="thisfile" type="file" id="thisfile">
</td>
<td width="137">
<%if (al.size()>2){%>
<img src="<%="images/"+al.get(2)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
128 X 128px:<input type="hidden" name="pixid" value="2">
<input name="thisfile2" type="file" id="thisfile2"></td>
<td width="137">
<%if (al.size()>5){%>
<img src="<%="images/"+al.get(5)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
160 X 128px:<input type="hidden" name="pixid" value="3">
<input name="thisfile3" type="file" id="thisfile3"></td>
<td width="137">
<%if (al.size()>8){%>
<img src="<%="images/"+al.get(8)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
160 X 150px:<input type="hidden" name="pixid" value="4">
<input name="thisfile4" type="file" id="thisfile4"></td>
<td width="137">
<%if (al.size()>11){%>
<img src="<%="images/"+al.get(11)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="20" colspan="2">
<input type="submit" name="Submit" value="确 定">
</td>
</tr>
</form>
<tr>
<td colspan="2">
</td>
</tr>
fileup.jsp file://showKid 图片类别bean DBconn 连接数据库
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*" errorPage="" %>
<jsp:useBean id="show" scope="page" class="test.showKid"/>
<jsp:useBean id="test" scope="page" class="test.DBconn"/>
<html>
<head>
<title>MMS图片上传</title>
<%@ include file="page.css"%>
</head>
<body>
<center>
<table width="500" height="500">
<form action="fileup_in.jsp" method="post" enctype="multipart/form-data" name="form1">
<tr>
<th height="30" colspan="3">MMS图片上传</th>
</tr>
<tr>
<td height="20" colspan="3">
图片路径:<input name="thisfile" type="file" id="thisfile">
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片类别:<%=show.showKid()%>
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片说明:<input type="text" class="pp" name="name" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
下载次数:<input type="text" class="pp" name="down" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
图片排序:<input type="text" class="pp" name="seqno" size="20">
</td>
</tr>
<tr>
<td height="20" colspan="3">
<input type="submit" name="Submit" value="确 定">
</td>
</tr>
</form>
<tr>
<td colspan="3" height="30">
</td>
</tr>
<%
int pid = show.getTop();
int i = 0;
Object tmpid;
Object pixid;
Object pic_url;
ArrayList al = new ArrayList();
try {
String sql = "select pid,pixid,pic_url from picturelib where pid="+pid+"";
ResultSet rs = test.executeQuery(sql);
while (rs.next())
{
tmpid = rs.getString(1);
pixid = rs.getString(2);
pic_url = rs.getString(3);
al.add(0,tmpid);
al.add(1,pixid);
al.add(2,pic_url);
i++;
}
}
catch(Exception e)
{
System.out.println("sql error");
}
file://System.out.println(al.size());
%>
<form action="fileup2_in.jsp" method="post" enctype="multipart/form-data" name="form1">
<tr>
<td width="351" height="60">
<input type="hidden" name="id" value="<%=pid%>">
30 X 30px: <input type="hidden" name="pixid" value="1"><input name="thisfile" type="file" id="thisfile">
</td>
<td width="137">
<%if (al.size()>2){%>
<img src="<%="images/"+al.get(2)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
128 X 128px:<input type="hidden" name="pixid" value="2">
<input name="thisfile2" type="file" id="thisfile2"></td>
<td width="137">
<%if (al.size()>5){%>
<img src="<%="images/"+al.get(5)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
160 X 128px:<input type="hidden" name="pixid" value="3">
<input name="thisfile3" type="file" id="thisfile3"></td>
<td width="137">
<%if (al.size()>8){%>
<img src="<%="images/"+al.get(8)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="60">
<input type="hidden" name="id" value="<%=pid%>">
160 X 150px:<input type="hidden" name="pixid" value="4">
<input name="thisfile4" type="file" id="thisfile4"></td>
<td width="137">
<%if (al.size()>11){%>
<img src="<%="images/"+al.get(11)%>" width="60" height="60">
<%}%>
</td>
</tr>
<tr>
<td height="20" colspan="2">
<input type="submit" name="Submit" value="确 定">
</td>
</tr>
</form>
<tr>
<td colspan="2">
</td>
</tr>
</table>
</center>
</body>
</html>
</table>
</center>
</body>
</html>
- commonfileupload
- commonfileupload组件文件上传
- 解决CommonFileUpload上传文件不能获取多选框
- 关于上传组件jspsmart和commonfileupload的一些感触!!!
- commonFileUpload处理上传文件和HTTP文件上传协议
- 使用commonfileUpload上传文件遇到后台中文乱码
- 纯C论坛·电子杂志·2004.10期(总第1期)正式发行!
- MSN上关于C++多重继承和多态的聊天记录
- web.xml //test.xml
- MSN上关于C++的异常处理和名字空间的聊天记录
- Linux+Apache+Mysql+PHP典型配置
- commonfileupload
- simple file upload
- 对于“不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成”问题的解决
- more file upload
- WSAStartup(MAKEWORD(2,2), &wsd) //导入socket2.0库
- 温馨提示:计算机族必喝的茶
- 我只在乎你,你知道吗?
- socket(AF_INET, SOCK_STREAM, IPPROTO_IP);//创建TCPsocket
- (bind(sListen, (struct sockaddr *)&local, sizeof(local))//把socket与IP和端口