S
S
Spoon in the brain2019-08-13 16:06:48
MySQL
Spoon in the brain, 2019-08-13 16:06:48

Which of the above methods is easier and better to create a photo upload to the database?

Good evening, I am creating a photo (avatar) upload to the server, but here I emphasized several ways for myself:
The first is to move the uploaded photo to the server, to some folder, and save the path to the uploaded photo in the database.
The second is to save the photo to the database itself, but I'm not sure about this method.
So, what is the best way for a small site?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anatoly, 2019-08-13
@Tolly

Of course, with a file, it is many times cheaper in terms of resources than pulling it from the database every time. It is desirable to keep the database completely in RAM.

V
Vladimir Druzhaev, 2019-08-14
@OtshelnikFm

Do they still store image files in the database in 2019?
Don't read old blogs. Store the files in the file system, and the paths to them - in the database
. Although there are perverted engines that store the layout of templates in the database ... where did this world turn ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question