How do you deal with uploading pictures in a general cms system?

1. The pictures uploaded by cms are stored in Qiniu, converted to base64, and stored in the database.
what are the advantages and disadvantages of each of these two approaches?

Jun.17,2021

generally speaking, it is not converted to base64, and stored in the database. Because in fact, the base64 is also very large, which will lead to a very large table.
generally speaking, a database is the url address where pictures are stored. While files always need a place to store,
generally speaking, there are two solutions, self-built storage and cloud storage


1: it is directly stored in the local directory of the server in the form of a file (this is what many small websites do, such as personal blogs).
2: upload to a special image server (Qiniu can see a special picture server)

both of the above pictures are placed in the disk directory.

there are very few people actually put pictures into the database after base64 (don't do this, you can forget this practice, no one in the actual project should do this).

for a slightly larger project, the images must be placed in a special image server (you can use the storage services provided by the service provider, such as Qiniu, or you can build your own image server).

as for the advantages and disadvantages of the above two kinds, there are a lot of them on the Internet.


put Aliyun.


oss is uploaded to Aliyun, and then the server database stores the image address


if you want to save the database, you can also store binary directly. There is no need to transfer it to BASE64
.


company level, all rented OSS; if you are playing with yourself, there are many free and limited storage services, it seems that 7 Niu has

.
Menu