📄 saveimg.jsp
字号:
<%@ page pageEncoding="GB2312"
import="java.util.Date"
import="java.text.*"
import="java.util.*"
import="java.io.*"
%>
<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="/inc/config.jsp" %>
<fmt:requestEncoding value="gb2312" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=webname%>-保存图片成功-<%=weburl%></title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<c:set var="newpicss" value="${fn:trim(param.newpics)}" />
<c:set var="newpics" value="${fn:replace(fn:trim(param.newpics),'/temporary','')}" />
<c:set var="copnewpics" value="/userimg${newpics}"/>
<table width="780" border="0" cellspacing="0" style="margin-bottom:5px">
<tr>
<td width="370"><a href="/"><img src="images/logo.gif" alt="<%=webname%>" width="368" height="82" border="0"></a></td>
<td align="center"><script src="/ad/ad400.js"></script></td>
</tr>
</table>
<table width="780" border="0" cellpadding="0" cellspacing="0" style="margin-bottom:1px">
<tr>
<td width="70" height="40"><img src="images/show_r2_c2.jpg" width="70" height="40"></td>
<td align="center" background="images/show_r2_c4.jpg"><a href="showlist.jsp"><img src="images/showimg.gif" width="59" height="15" border="0"></a></td>
<td width="59" align="center"><img src="images/show_r2_c6.jpg" width="59" height="40"></td>
<td align="center" background="images/show_r2_c4.jpg"><a href="background.jsp"><img src="images/bjimg.gif" width="74" height="15" border="0"></a></td>
<td width="59" align="center"><img src="images/show_r2_c6.jpg" width="59" height="40"></td>
<td align="center" background="images/show_r2_c4.jpg"><a href="up.jsp" target="_blank"><img src="images/diy.gif" width="83" height="15" border="0"></a></td>
<td width="59" align="center"><img src="images/show_r2_c6.jpg" width="59" height="40"></td>
<td align="center" background="images/show_r2_c4.jpg"><a href="help" target="_blank"><img src="images/help.gif" width="89" height="15" border="0"></a></td>
<td width="61"><img src="images/show_r2_c8.jpg" width="61" height="40"></td>
</tr>
</table>
<table width="780" border="0" cellspacing="0" style="margin-bottom:5px">
<tr>
<td><script src="/ad/ad780.js"></script></td>
</tr>
</table>
<table width="780" border="0" cellpadding="5" class="p4" style="margin-bottom:5px">
<tr>
<td align="center"><B>保存图片成功</B></td>
</tr>
<%
String copnewpics = "";
String urlname = new StringBuffer(request.getRequestURL()).toString();
urlname=urlname.substring(0,urlname.lastIndexOf("/"));
try {
copnewpics=(String)pageContext.getAttribute("copnewpics");
String newpicss=(String)pageContext.getAttribute("newpicss");
File f = new File(request.getRealPath("/")+newpicss);
//检察目录是否存在,不存在就建立
int wz = copnewpics.lastIndexOf("/");
String ml = copnewpics.substring(0,wz);
String m_path=request.getRealPath("/")+ml;
java.io.File r_path=new java.io.File(m_path);
if(!r_path.exists())
{
r_path.mkdir();
}
//检察目录是否存在,不存在就建立/
if (f.isFile()) {
int c;
FileInputStream in1 = new FileInputStream(f);
File x = new File(request.getRealPath("/")+copnewpics);// 新文件
FileOutputStream out1 = new FileOutputStream(x);
c = (int) f.length();
byte[] b = new byte[c];
in1.read(b);
in1.close();
out1.write(b);
out1.close();
%>
<tr>
<td align="center"><a href="${newpics}" target="_blank"><img id="show" src="<%=copnewpics%>" border="0" onload="if(this.width>700) {this.alt=this.title; this.width=700;}"></a></td>
</tr>
<%
}else{
%>
<tr>
<td align="center">
<table width="300" border="0" cellpadding="5" class="p4">
<tr>
<td align="center">没有找到图片文件,操作出错!</td>
</tr>
<tr>
<td align="center">
<input type="button" name="Button" value="关闭窗口" onClick="window.close();"></td>
</tr>
</table> </td>
</tr>
<%
}
%>
<%
} catch (Exception e1) {
%>
<tr>
<td align="center">
<table width="300" border="0" cellpadding="5" class="p4">
<tr>
<td align="center">保存存过程中出现异常,操作失败!</td>
</tr>
<tr>
<td align="center">
<input type="button" name="Button" value="关闭窗口" onClick="window.close();"></td>
</tr>
</table> </td>
</tr>
<%
}
%>
<tr>
<td align="center">
图片保存成功,你可以使用以下的地址进行贴图等操作。
</td>
</tr>
<tr>
<td align="center">
<script language="javascript">
function copy_url1() { window.clipboardData.setData("text", "[img]<%=urlname+copnewpics%>[/img]"); alert("复制成功!你可以去论坛贴图了!"); }
document.writeln('网络贴图代码:<input type="text" size="65" value="[img]<%=urlname+copnewpics%>[/img]" onclick="copy_url1()">');
document.writeln('<input type="button" value=" 复制贴图代码 " onclick="copy_url1()">');
</script>
</td>
</tr>
<tr>
<td align="center">
<script language="javascript">
function copy_url() { window.clipboardData.setData("text", "<%=urlname+copnewpics%>"); alert("复制成功!你可以去论坛贴图了!"); }
document.writeln('图片临时地址:<input type="text" size="65" value="<%=urlname+copnewpics%>" onclick="copy_url()">');
document.writeln('<input type="button" value=" 复制图片地址 " onclick="copy_url()">');
</script>
</td>
</tr>
</table>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><jsp:include page="bottom.jsp" /></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -