1oneSquared
1oneSquared

Reputation: 113

Upload image, encode to base64 Spring MVC

I have a question. I'm working on a Spring web MVC project where I need to upload an image, convert it to base64 and then write it to a mysql database. I'm very new to spring and I've searched the web finding a lot of tutorials that just don't really fit my answer. I basically don't know where to start..do I use javascript to do this in the jsp file? Or is it better to use java? I literally have no idea where to start, it sounds difficult to me but I'm sure there is a very easy way to do this. I just have to get used to spring a little bit more. Can someone please point me in a direction about how to do this? Also, I'm using annotations and no xml.

Thanks in advance!

Upvotes: 2

Views: 3900

Answers (1)

Vikas Jaiswal
Vikas Jaiswal

Reputation: 66

Create Spring controller and send image file as multipart request to that controller, then convert image to base64 in java.

See this

Upvotes: 1

Related Questions