I have created a form that has 2 file uploads and a few text content, it successfully uploads data in DB, when I'm trying to re-edit/update the same form. Either I'm getting bad request error if I use Multipart along with entity class. If I use multipart without entity it is creating new records but not updating the old records.
when add the entity class to this along with @RequestParam("file") MultipartFile file to save the file and other details iam getting an error while updating data.
Following is code:
@PostMapping("/update")
public String update(@RequestParam("bookPath") MultipartFile file, @RequestParam("bookCover") MultipartFile cover,
@RequestParam("bookName") String bookName, @RequestParam("totalpages") String totalpage,
@RequestParam("bookAuthor") String BA,@RequestParam("bookPrice") String Bp,
@RequestParam("bookPublicationDate") String bpd, @RequestParam("bookRating") String bookRating,
@RequestParam("bookDesc") String Bdes, @RequestParam("ReadingAge") String readingAge,
@RequestParam("AudioBook") String Ab,@RequestParam("isbn_num") String isbn,
@RequestParam("status") String satus,
@RequestParam("discount_option") String discount, @RequestParam("genres") String genras,
@RequestParam("dicsounted_price") String fixed_dis,
@RequestParam("percentge_value") String percentage, Book_dtls b)
Book_dtls is the entity class.
Error Imagelike below image.
i want to update the data along with files