1. Download the source code of the jspsmartupload project. Http://www.zhenhua.org/article.asp? You can download the address id = 380. Decompress the downloaded source code to the webapps folder under the Tomcat directory, enable tomcat, and access the sample page in the browser.
2. Apply jspsmartupload to your project. You need to generate a jar file for jspsmartupload. The specific method is. enter the command line status, switch the directory to Tomcat's webapps/jspsmartupload/WEB-INF directory B. run the jar package command: jar CVF jspsmartupload. jar com puts the generated jar into the Lib folder of the project
3. when using jspsmartupload, note that the form method = "Post" enctype = "multipart/form-Data" must be added with import = "com. jspsmart. upload. * "and <JSP: usebean id =" mysmartupload "Scope =" page "class =" com. jspsmart. upload. smartupload "/>
Processing time
Mysmartupload. initialize (pagecontext );
Mysmartupload. settotalmaxfilesize (10000000 );
Mysmartupload. Upload ();
Try {
Mysmartupload. Save ("/upload ");
} Catch (exception e ){
Out. println (E. tostring ());
}
4. Note that other attributes in the form should be obtained through mysmartupload. getrequest (). getparameter ("name.