I am wondering why does spring boot convert MultiPartFile file's name special characters into ? (for eg. ééé.pdf gets converted to ???.pdf). Do I need to configure Spring to disabled this behaviour ? I have checked my jvm configuration for file.encoding and it's already set to UTF-8.
I perform the file upload this way :
@PostMapping("/upload")
public void uploadFile(@RequestParam MultipartFile file){
// todo : ...
}
You can try this
String originalFileName = URLDecoder.decode(file.getOriginalFilename(), "UTF-8");
Hope useful for you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With