?? upload_post.jsp
字號:
<%@ include file = "../../config.jsp" %>
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<%
//--- 上傳模塊 ---
String TimeStamp=java.lang.String.valueOf((new Date()).getTime());
String Msg = null;
mySmartUpload.initialize(pageContext);
mySmartUpload.upload();
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
if (myFile.getFileExt().equals("jpg") || myFile.getFileExt().equals("gif"))
if (myFile.getSize() < MaxFileSize)
if (!myFile.isMissing()) {
String path = request.getRealPath(".");
myFile.saveAs(path + "/../../" + UploadFolder + "/" + TimeStamp + "."+myFile.getFileExt());
Msg = "上傳成功!";
session.putValue("NewImgName",TimeStamp + "." + myFile.getFileExt());
}
else {
Msg = "上傳不成功![<a href=javascript:history.back()>返回</a>]";
}
else {
Msg = "體積過大![<a href=javascript:history.back()>返回</a>]";
}
else {
Msg = "不允許上傳這類文件![<a href=javascript:history.back()>返回</a>]";
}
out.print("<font size=2>" + Msg + "</font>");
%>
<body bgcolor="eeeeee">
</body>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -