enctype 属性指定表单数据在提交到服务器时应如何编码。
注意: 只有在 method="post" 时才能使用 enctype 属性。
enctype 属性可用于以下元素:
| 元素 Element | 属性 Attribute |
|---|---|
| <form> | enctype |
发送编码为“multipart/form-data”的表单数据:
<form action="/action_page_binary.asp" method="post" enctype="multipart/form-data"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit"> </form>
| 属性 Attribute |
|
|
|
|
|
|---|---|---|---|---|---|
| enctype | Yes | Yes | Yes | Yes | Yes |