HTML <form> enctype 속성
예시
"multipart/form-data"로 인코딩된 양식 데이터 보내기:
<form action="/action_page_binary.asp"
method="post" enctype="multipart/form-data">
<label for="fname">First name:</label>
<input type="text" id="fname"
name="fname"><br><br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname"><br><br>
<input
type="submit" value="Submit">
</form>
정의 및 사용
이 enctype
속성은 양식 데이터를 서버에 제출할 때 양식 데이터를 인코딩하는 방법을 지정합니다.
참고: 속성은 인 enctype
경우에만 사용할 수 있습니다
method="post"
.
브라우저 지원
Attribute | |||||
---|---|---|---|---|---|
enctype | Yes | Yes | Yes | Yes | Yes |
통사론
<form enctype="value">
속성 값
Value | Description |
---|---|
application/x-www-form-urlencoded | Default. All characters are encoded before sent (spaces are converted to "+" symbols, and special characters are converted to ASCII HEX values) |
multipart/form-data | This value is necessary if the user will upload a file through the form |
text/plain | Sends data without any encoding at all. Not recommended |
❮ HTML <form> 태그