Recently, I encountered a type receiving error when uploading with springmvc. The input tag of file type is set in the JSP form, but an error is reported when receiving with multipartfile in springmvc, which roughly means that string convert multipartfile has an error. Finally, I know that I am using form submission. The enctype attribute in the form must be set to enctype = “multipart/form data”, Because only this attribute means that the file file is uploaded, and I didn’t write it
The enctype in the form has three attributes: 1. Application/x-www-form-urlencoded. 2、multipart/form-data。 3、text/plain
1: Encode all characters before encoding, including special characters, convert spaces to “+” symbols, and special characters to ASCII hex values. It is also the default setting for form
2: No character encoding. This value must be used when using a form containing a file upload control, and the file will be read in a binary stream
3: Spaces are converted to a “+” plus sign, but special characters are not encoded
Similar Posts:
- CSRF verification failed. Request aborted [How to Solve]
- Postman reported an error unsupported media type [How to Solve]
- XML parsing & special character error
- gitfatal: I don’t handle protocol ‘https’ [How to Solve]
- Spring Error: ‘artifactId‘ with value ‘xxxx‘ does not match a valid id pattern.
- When using SQL(), dataset can’t use map, flatmap and other conversion operators
- Httprunner3 – special character processing: get the content type from the returned header (the error has been solved: bad jmespath expression: unknown token ‘-‘)
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1:
- Keras.utils.to in keras_ Categorical method
- [Solved] Python Error: UnicodeDecodeError: ‘gb2312’ codec can’t decode byte 0xa4 in position… : illegal multibyte sequence