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

📄 sample3.jsp

📁 一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.
💻 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 3</H1>
<HR>

<%
	
	// Variables
	   int count=0;        

	// Initialization
		mySmartUpload.initialize(pageContext);

	// Only allow txt or htm files
	   mySmartUpload.setAllowedFilesList("htm,html,txt,,");

	// DeniedFilesList can also be used :
    // mySmartUpload.setDeniedFilesList("exe,bat,jsp");

	// Deny physical path
	// mySmartUpload.setDenyPhysicalPath(true);

	// Only allow files smaller than 50000 bytes
	// mySmartUpload.setMaxFileSize(50000);

	// Deny upload if the total fila size is greater than 200000 bytes
	// mySmartUpload.setTotalMaxFileSize(200000);

	// Upload	
	   mySmartUpload.upload();

	// Save the files with their original names in a virtual path of the web server
	   try {

		 count = mySmartUpload.save("/upload", mySmartUpload.SAVE_VIRTUAL);
	  
	   } catch (Exception e){

	 	 out.println("<b>Wrong selection : </b>" + e.toString());

	   }
   		
	// Display the number of files uploaded
	   out.println(count + " file(s) uploaded.");

%>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -