For scalability considerations, there may be more pictures in the future, or even unlimited pictures. If they are all stored in the server memory, it will definitely not be suitable; if your service is deployed on Alibaba Cloud, buy oss and use the intranet. When you want to use pictures, get them from OSS and store them back in OSS. If they are not on Alibaba Cloud, you can also buy the corresponding cloud storage on other cloud services. Be careful not to purchase cloud services separately, which will require you to go outside the network. Get the picture. If it is your own server, store it in a database, such as mongo. The above storage is all binary of the stored files. In fact, there is no reading of files or memory leaks. Just write the code well.
For scalability considerations, there may be more pictures in the future, or even unlimited pictures. If they are all stored in the server memory, it will definitely not be suitable; if your service is deployed on Alibaba Cloud, buy oss and use the intranet. When you want to use pictures, get them from OSS and store them back in OSS. If they are not on Alibaba Cloud, you can also buy the corresponding cloud storage on other cloud services. Be careful not to purchase cloud services separately, which will require you to go outside the network. Get the picture. If it is your own server, store it in a database, such as mongo. The above storage is all binary of the stored files. In fact, there is no reading of files or memory leaks. Just write the code well.