JSP smartupload File Upload

Source: Internet
Author: User

File Upload (I) form requirements for the Form of the file to be uploaded, there are two requirements: 1. The method applies post, that is, method = "Post ". 2. Add attributes: enctype = "multipart/form-Data". The following is an example of a form used to upload files:
<Form method = "Post" enctype = "multipart/form-Data" Action = "/jspsmartupload/upload. JSP "> <input type =" file "name =" myfile "> <input type =" Submit "> </form>
(Ii) Upload Example 1: upload page upload.html This page provides a form that allows users to select the file to be uploaded and click "Upload" to perform the upload operation. The page source code is as follows:
<! -- File name: upload.html Author: vertical and horizontal software production center Yu Yiqi (zhsoft88@sohu.com) --> <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en"> <HTML>
2. Upload the file on the do_upload.jsp page. The page source code details the usage of the upload method, which will not be repeated here. The page source code is as follows:
<% -- File name: do_upload.jsp Author: Landscape software production center Yu Yiqi (zhsoft88@sohu.com) -- %> <% @ page contenttype = "text/html; charset = gb2312 "Language =" Java "Import =" Java. util. *, Com. jspsmart. upload. * "errorpage =" "%> <HTML>
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.