⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_upload_book_picture.jsp

📁 图书管理系统,B/S,C/S都有,附有源代码
💻 JSP
字号:
<%@ page language="java" pageEncoding="GBK"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@page import="java.util.Enumeration"%>
<%@page import="com.oreilly.servlet.MultipartRequest"%> 
<jsp:useBean id="ResizePic" scope="page" class="upload.ResizePic" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<link rel=stylesheet href="../css/library.css" type="text/css">
<title>图书管理系统</title>
</head>

<body>
<%
String supervisor = (String)session.getAttribute("supervisor");//从SESSION中获取管理员ID
if(supervisor != null){
	//获得网站根目录的绝对路径
	String path=getServletContext().getRealPath("/");
	//上传文件和生成的缩略图的保存路径
	String saveDirectory = path + "BookPicture\\";
	String resizeDirectory = saveDirectory + "resize\\";
	//每个文件最大5m,最多3个文件,所以...
	int maxPostSize = 3*5*1024*1024;
	//response的编码为"GBK",同时采用缺省的文件名冲突解决策略,实现上传
	MultipartRequest multi = new MultipartRequest(request, saveDirectory, maxPostSize,"GBK"); 
	//输出反馈信息 
	Enumeration files = multi.getFileNames();
	String name = (String)files.nextElement();
	String fileName = multi.getFilesystemName(name);
	ResizePic.s_pic(saveDirectory, resizeDirectory, fileName, fileName, 132, 149, true);
%>
	<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center">
		<tr>
			<td>
				<table cellpadding="3" cellspacing="1" border="0" width="550">
					<tr>
						<td height="22" bgcolor="#6CA6D5" align="center"><p style="font-size: 16px;"><strong>上传成功</strong></p></td>
					</tr>
					<tr bgcolor="#DCEFFA">
						<td height="30" align="center">图书图片成功,请关闭此窗口!</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20" bgcolor="#6CA6D5" align="center">&nbsp;</td>
		</tr>
	</table>
<%
}else{
%>
	<table cellpadding="0" cellspacing="0" border="0" width="550" bgcolor="#2E79BE" align="center">
		<tr>
			<td>
				<table cellpadding="3" cellspacing="1" border="0" width="550">
					<tr>
						<td height="22" bgcolor="#6CA6D5" align="center"><p style="font-size: 16px;"><strong>图书管理系统</strong></p></td>
					</tr>
					<tr bgcolor="#DCEFFA">
						<td height="30" align="center">对不起,您尚未登录!</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td height="20" bgcolor="#6CA6D5" align="center">&nbsp;</td>
		</tr>
	</table>
<%
}
%>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -