AR삽질러

JSP - 파일업로드(자카르타API) 본문

JAVA/JSP

JSP - 파일업로드(자카르타API)

아랑팡팡 2023. 3. 10. 17:16
728x90

- 자카르타(Jakarta)는 Java를 기반으로 하는 웹 애플리케이션 프레임워크로 Jakarta는 기본적으로 Java EE의 기능을 계승하면서도 더욱 가볍고 유연한 구조를 가진다.

- 자카르타는 다양한 API를 제공하는데 파일 업로드와 관련된 API도 그 중 하나다. Jakarta Servlet API를 기반으로 하는 Jakarta Multipart API를 사용하여 파일 업로드를 처리할 수 있다.

- Jakarta Multipart API를 사용하려면 HTML form에서 enctype="multipart/form-data"로 지정된 form을 생성한후 서블릿에서 HttpServletRequest 객체를 사용하여 업로드된 파일을 처리할 수 있습니다.

 

1. https://commons.apache.org/proper/commons-fileupload/download_fileupload.cgi

 

FileUpload – Download Apache Commons FileUpload

Download Apache Commons FileUpload Using a Mirror We recommend you use a mirror to download our release builds, but you must verify the integrity of the downloaded files using signatures downloaded from our main distribution directories. Recent releases (4

commons.apache.org

아파치에 접속해 commons-fileupload와 밑에 io를 다운를 다운받는다.

 

2. https://commons.apache.org/proper/commons-io/download_io.cgi

 

Commons IO – Download Apache Commons IO

Download Apache Commons IO Using a Mirror We recommend you use a mirror to download our release builds, but you must verify the integrity of the downloaded files using signatures downloaded from our main distribution directories. Recent releases (48 hours)

commons.apache.org

 

3. FileUploadEx

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>FileUploadForm</title>
</head>
<body>
<form action="processFileUpload.jsp" method="post" enctype="multipart/form-data">
파일1 : <input type="file" name="file1"><br>
파일2 : <input type="file" name="file2"><br>
파일2 : <input type="file" name="file3"><br>
파라미터1 : <input type="text" name="param1"><br>
파라미터2 : <input type="text" name="param2"><br>
파라미터3 : <input type="text" name="param3"><br>
<input type="submit" value="전송">
</form>
</body>
</html>

 

 

 

 

728x90
반응형
LIST

'JAVA > JSP' 카테고리의 다른 글

JSP - JSTL(JSP Standard Tag Library)  (0) 2023.03.12
JSP - 표현언어(Expression Language)  (0) 2023.03.10
JSP - 파일업로드  (0) 2023.03.10
Session  (0) 2023.03.10
Cookie  (0) 2023.03.10