Knife4j檔案上傳不顯示上傳選擇文字域

槑孒發表於2024-08-10

Knife4j 4.5.0

@RequestParam改用@RequestPart即可

@Operation(summary = "上傳檔案")
@PostMapping("upload")
public Result<String> upload(@RequestPart MultipartFile file) throws Exception {
    String url = fileService.upload(file);
    return Result.ok(url);
}

相關文章