How to upload pictures to the app based on Spring Boot?

Good present, dear users. A small application based on Spring Boot. There is a need to store in the database attached to this application, not only the string information, but also pictures. Tell me, please, how is it done?
Many thanks in advance for your answers!
June 10th 19 at 15:41
2 answers
June 10th 19 at 15:43
Store in a database a string with the file name and the picture separately on disk.
Thanks for the advice, but the task is precisely to store it somewhere in the Internet (school project), ideally in the DB... - Fidel27 commented on June 10th 19 at 15:46
here is a good article about the pros and cons of storage

generally Yes, in relationto is better not to keep definitely
usually keep them somewhere not another server and in the database keep a reference to them - Cristobal_Bernier commented on June 10th 19 at 15:49
June 10th 19 at 15:45
public class User {
 @GeneratedValue(strategy = GenerationType.AUTO)
 private Long id;


 @Basic(fetch = FetchType.LAZY)
 private byte[] userpic;

Find more questions by tags DatabasesJavaSpring