HTML <form> enctype 属性, 表单上传

1.

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

2.

<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>

  

原文地址:https://www.cnblogs.com/ygyy/p/13019996.html