<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<p align="center">上传文件选择</p>
<FORM method="post" enctype="multipart/from-data" action="doupload.jsp">
<INPUT TYPE="FILE" NAME="MYFILE"><br/>
<INPUT TYPE="SUBMIT">
</FORM>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="com.jspsmart.upload.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
SmartUpload su= new SmartUpload();
su.initialize(pageContext);
su.setAllowedFilesList("jpg,gif,npg");
su.upload();
Files files =su.getFiles();
out.print("apsojp3");
for(int i=0; i<files.getCount();i++){
out.print("apsojp2");
File file=files.getFile(i);
if(!file.isMissing()){
file.saveAs("/upload/a.jpg",File.SAVEAS_AUTO);
out.print("apsojp");
}
}
%>
</body>
</html>