📄 sample1.jsp
字号:
<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<HTML>
<BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 1</H1>
<HR>
<%
// Variables
int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
mySmartUpload.setTotalMaxFileSize(100000);
// Upload
mySmartUpload.upload();
try {
// Save the files with their original names in the virtual path "/upload"
// if it doesn't exist try to save in the physical path "/upload"
count = mySmartUpload.save("/upload");
// Save the files with their original names in the virtual path "/upload"
// count = mySmartUpload.save("/upload", mySmartUpload.SAVE_VIRTUAL);
// Display the number of files uploaded
out.println(count + " file(s) uploaded.");
} catch (Exception e) {
out.println(e.toString());
}
%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -