<%@ page contentType="text/html; charset=gbk" language="java" import="com.jspsmart.upload.SmartUpload" errorPage="" %><HTML>
<BODY BGCOLOR='white'><H1>jspSmartUpload : Servlet Sample</H1>
<HR>
 <%
request.setCharacterEncoding("gbk");
  int count = 0;
  SmartUpload mySmartUpload = new SmartUpload();
  try {
   mySmartUpload.initialize(config, request, response);
   mySmartUpload.upload();
   
   for (int i = 0; i < mySmartUpload.getFiles().getCount(); i++) {
    com.jspsmart.upload.File myfile = mySmartUpload.getFiles().getFile(i);
    String fileName = myfile.getFileName();
    count = mySmartUpload.save("/upload");
    /*myfile.saveAs("/upload/"+fileName);*/
  
   }
   out.println("other="+mySmartUpload.getRequest().getParameter("other"));
   out.println(count + " file uploaded.");
  } catch (Exception e) {
   out.println("Unable to upload the file.<br>");
   }
%>
</BODY>