SpringCloud upload file, Chinese file name garbled solution

Recently, in the process of using SpringCloud to build microservices, it was
found that when the uploaded file was not forwarded by the Zuul gateway, the response was that the upload file name was garbled in Chinese and the file writing operation failed, which caused the file upload to fail. However, when the file was forwarded by Zuul, the file The upload is normal, so it is guessed that Zuul processed the encoding of the uploaded request. Finally found two solutions on the Internet:

Solution 1: Add the string "zuul" before the request path of the uploaded file to declare that the encoding of this request will not be processed.

Insert picture description here
Solution 2:
Add the following attribute to the zuul configuration file:

zuul.servlet-path=/

Guess you like

Origin blog.csdn.net/qq_40145879/article/details/107255673