Home > Backend Development > PHP Tutorial > Are pictures generally placed on the server or in the database?

Are pictures generally placed on the server or in the database?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-12 17:44:46
Original
2892 people have browsed it

Should the file name and path be stored in the database or should the image be converted into binary and stored in the database? Which method is generally used?

Reply content:

Should the file name and path be stored in the database or should the image be converted into binary and stored in the database? Which method is generally used?

Save the file name and path in the database.
It is best to put the images in CDN.

Usually placed on the server, data inventory path.

What application scenarios are you looking at?

Reading files is faster than reading database records, but the limitation is that it can only read local paths (of course remote files can be solved through sharing methods such as NFS). In addition, when the file size is very inconsistent (such as as small as two or three KB and as large as two or three GB), the file content must not be placed in the database.

Just save the path in the database

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template