Home > database >  How to Insert Image in Sprint MVC project?
How to Insert Image in Sprint MVC project?

Time:10-24

i am working on spring-MVC project.in one feature implementation i need to take picture from the user and i need to save in MySQL database.is there any solution to that?

CodePudding user response:

An easy way to do it:

  1. You can save image in the folder.
  2. Then save image url in database.
  3. When you need an image,you can find it in the folder through the url.

CodePudding user response:

Given that you already have a database, the simplest solution is to store image into appropriate blob column. If your images are stored in database you will automatically apply all database qualities for storing data (backup etc) to the images stored.

Here is simple tutorial on this subject: "Spring JDBC - Handling BLOB".

  • Related