/ /========upload.html===========
form>
body>
html>
/ /=========upload.jsp=======
<% @ page language = "java" import = "com.jspsmart.upload. *"%>
<%
/ / Define count variables
INT count = 0;
//initialization
MySmartupload.initialize (PageContext);
// Set the maximum upper limit of the file, here is 100KB
MySmartupload.SettotAlMaxFileSize (1000000);
/ / Call the method of instantiated objects of beans to perform upload operation / R
mysmartupload.upload ();
Try {
/ / In the UPLOAD directory store file in the virtual directory
// There is no virtual path to use physical paths, very familiar "/ upload"
Count = mysmartupload.save ("/ upload");
/ / By default, the upload file homologous file name is the same
//count=mysmartupload.save ("/upload" ,mysmartupload.save_virtual);
/ / Display the number of files that have been uploaded
Out.println (count "file (s) Uploaded.");
} catch (exception e) {
Out.println (E.TOString ());
}
%>