웹/jsp
jsp11 -파일 업로드
밍래그로프
2021. 1. 27. 13:43
A.업로드
1.형태
<from method="post" enctype="mutilpart/form-data">
<input type="file" name="filename">
<form>
2.특징
바이너리 파일에는 enctype = mutilpart/form-data 로 해야한다.
method도 post를 사용한다.
B>서블릿의 COS 라이브러리
servlet.com으로 가면 cos 라이브러리란게 있다. (굉장히 오래되었다...)
다운받고 압축풀고 폴더의 lib의 cos.jar를 web-inf 의 하위의 lib에 넣자
사용법
Z>MIME 타입
텍스트, 비디오, 오디오 등
application/octet-stream