The request params are shown in the network but the second param (fileId) is received as null in the controller. The request returns 400 bad request.
@PostMapping(path = "/uploadFile")
public ResponseEntity<ServiceResponse> upload(
@RequestParam(value = "id") Long userId,
@RequestParam(value = "fileId") Long fileId,
@RequestPart(value = "file") MultipartFile... file) {
//
return ResponseEntity.ok(serviceResponse);
}
request URL: (the file is sent in the body: formData) http://localhost:8080/api/upload?id=9999&fileId=101
fileIdkey in your form-data? i.e. does thefileparameter contain afileIdkey? Because yourfileIdRequestParam should not benullwith the request you provided, unless afileIdkey is also part of the MultipartFile. - Troley