JSP file upload open-source project jspsmartupload Application

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.