#Spring upload file ( hibernate)
27 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @sharp cargo! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
https://github.com/VanThen60hz/codegym-module4/tree/main/ss5-manipulate-with-database%26ORM/exercise/e1_music_webapp_server2
this is my github source for this problem]
u can dowload this file and test this problem
MultipartFile assumes that the HTTP request is multipart as well. adding enctype="multipart/form-data" to your form element should be your first step.
your controller's multipart parameter should be annotated as a @RequestBody
you can't send a multipart request in a single query parameter of a request
i don't think that. i used @ModelAttribute for song model and just used one @RequestParam for to harbor file, i use it ok when use spring boot but when i applied it in hibernate. i don't know why it not working
well, maybe it's able to get it to work somehow, but semantically it makes no sense to mark a multipart file as a request param
can i know ur solution when using multipart file
my solution is create a class file like this
and registry it to @wind martenuration
.
usually I just add it to a controller's @PostMapping method
can i have the example
maybe I have one from one of my old projects
actually I can't find a non-proprietary example
anyway, thanks ur help
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
i will wait for anyone can solve this problem
Meanwhile, i will use spring boot to solve this upload file. Even i still want to know what problem in my code. I wish anyguy here can find it. Haizz.
i fixed this problem (with my friend help)