Latest web development tutorials

HTML forma atributo enctype

Etiqueta de formulario HTML Reference etiqueta <form> HTML

Ejemplos

Enviar a "multipart / form-data" datos de forma codificada:

<form action="demo_post_enctype.html"
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="提交">
</form>

Trate »

Soporte para el navegador

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Todos los principales navegadores soportan atributo enctype.


Definición y Uso

enctype atributo especifica el formulario antes de enviar los datos al servidor de la forma en que se codifican.

Nota: Sólo elmethod = "post" cuando se utiliza el atributo enctype.


Diferencias entre HTML 4.01 y HTML5

Ninguno.


gramática

<form enctype="value">

propiedad Valor

描述
application/x-www-form-urlencoded 默认。在发送前对所有字符进行编码(将空格转换为 "+" 符号,特殊字符转换为 ASCII HEX 值)。
multipart/form-data 不对字符编码。当使用有文件上传控件的表单时,该值是必需的。
text/plain 将空格转换为 "+" 符号,但不编码特殊字符。


Etiqueta de formulario HTML Reference etiqueta <form> HTML