79526688

Date: 2025-03-21 22:43:27
Score: 1
Natty:
Report link

The issue is in how you're handling file uploads in your frontend code. The MultipartException occurs because:

1- You're adding enctype="multipart/form-data" to your form, but the form isn't actually being submitted, instead you're using Axios directly.

2- Your Axios request in addNewAsset() isn't configured to send multipart/form-data:

addNewAsset(asset) {
    return axios.post(ASSETS_GOT_FROM_REST_API, asset);
}

3- Your Spring controller expects @RequestParam files but is receiving them as part of the @RequestBody

this is all the problem i saw.

also use FormData in your JavaScript to properly handle multipart uploads.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @RequestParam
  • User mentioned (0): @RequestBody
  • Low reputation (1):
Posted by: ayman belqadi