📄 upimg_head.jsp~121~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="javax.servlet.http.HttpServletRequest" %>
<%@ page import="com.bwm.model.Head" %>
<%@ page import="com.bwm.core.*" %>
<%@ page import="com.jspsmart.upload.*" %>
<%if (!Crazyadept.UserIsOK(session,FinalConstants.STATUS_ADMIN)) return;%>
<jsp:useBean id="up" scope="page" class="com.jspsmart.upload.SmartUpload" /> <table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="27"><% session.removeAttribute("error");
int count=0; up.initialize(pageContext);
up.setTotalMaxFileSize(100000);
up.setAllowedFilesList("gif,jpg");
try{up.upload();}catch(Exception e){} BasetableFactory bf=BasetableFactory.getInstance();
//
java.util.Random r=new java.util.Random(System.currentTimeMillis()+1);
long longr=r.nextLong();
long longd=System.currentTimeMillis()+longr;
String name=new Long(longr).toString();
name=name.replace('-','_');
File f=up.getFiles().getFile(0);
String path="images/ico/"+name+"."+f.getFileExt();
//
if(!f.isMissing()){
try { f.saveAs(path);} catch (Exception e) {}
if(bf.CreateHead(name,path,FinalConstants.STATE_HEAD)){
out.println("上传成功");
}else{
session.setAttribute("error","上传失败");
response.sendRedirect("errorw.jsp");}}
}}%></td>
</tr>
<tr>
<td align="center" valign="bottom"><a style="cursor:hand" onClick="javascript:history.back();">返回上页</a> <a style="cursor:hand" onClick="javascrip:opener.location.reload();window.close();">关闭窗口</a></td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -