Entype attribute selection of form form

  1. How to select the entype attribute value when uploading files?     

      When uploading files, you must specify the enctype (encode type, encoding type) attribute of the form as multipart/form-data, which means that the form data consists of multiple parts, including text and binary data such as files. Specify the browser to use binary upload, otherwise browse The server uses ASCII to send data by default, causing file sending to fail.

2. What is the default value?

enctype attribute value:

The default enctype is application/x-www-form-urlencoded, and only files in plain text format can be uploaded.


3. What are the three attribute values? When to use it?

application/x-www-form-urlencoded:在发送前编码all字符。
multipart/form-data:不对字符编码,指定传输数据为二进制类型。
text/plain:纯文本的传输,空格转换为加号,但不对特殊字符编码。

Guess you like

Origin blog.csdn.net/smallmww/article/details/132330415
Recommended