fileUpload file upload

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

fileUpload file upload

FileUpload is a sub-project under Apache commons, which is used to implement the file upload function in the Java environment.

1. Create a jsp page for uploading files, set the enctype attribute of the FORM form to "multipart/form-data", code example:

image

2. Receive the data Servlet class of the uploaded file:

image

image

image

Visit the jsp page:

image

Console prints:

image

Successfully uploaded images:

image

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326437119&siteId=291194637