<Spring Boot file upload doesn't work (bad request...
# stackoverflow
u
Spring Boot file upload doesn't work (bad request) I'm trying to do a simple file upload via a Rest API created with Spring Boot and Kotlin. This is my code: @RestController @RequestMapping("/api") class Controller { @PostMapping("/upload") fun handleFileUpload(@RequestParam("file") file: MultipartFile): ResponseEntity { try { file.transferTo(File("C:\\upload\\" + file.originalFilename)) } catch (e: Exception) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build()...