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

📄 upimg_head.jsp~99~

📁 一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.
💻 JSP~99~
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="javax.servlet.http.HttpServletRequest" %>
<%@ page import="com.bwm.model.Head" %>
<%@ page import="com.bwm.core.*" %>
<%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();
        String name=up.getFiles().getFile(0).getFileName();        Head h=bf.SearchHead("WHERE iid='"+name+"'");
        //File f=new File(request.getRealPath("/images/ico")+File.separatorChar+up.getFiles().getFile(0).getFileName());
        if(h.getIid()==null||"".equals(h.getIid())){
            try { count = up.save("images/ico");} catch (Exception e) {}
                if(count==1){                    if(bf.CreateHead(name,"images/ico/"+name,FinalConstants.STATE_HEAD)){
                        out.println("上传成功");
                }else{
                        session.setAttribute("error","上传失败");
                        response.sendRedirect("errorw.jsp");}}else{
                        session.setAttribute("error","上传失败");
                        response.sendRedirect("errorw.jsp");
                }}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>&nbsp;&nbsp;<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 + -