Springboot project, the backend stores pictures to a directory of the project, how to write the path?

1.springboot project structure is shown in the figure

clipboard.png

2.UploadControllerimages
"templates/images/","./main/resources/templates/images/" url:

clipboard.png

Mar.01,2021

your front-end url is a temporary cache url, not the actual url of the server.
your function is to upload pictures. Then get the image stream directly on the Controller side and write it to the corresponding directory.

 
UploadController is responsible for receiving the picture file at the backend and saving it to the images path of the project

the key is to just store it, right? What to do after storage (such as as a resource for users to access? )? If it's just storage, just find a directory on the server to store it

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e83e07-c8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e83e07-c8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?