php - Storing filesize in database vs calling filesize()

37

I keep my uploaded images all in one folder, each with a database entry that contains a link to the file, to the thumbnail, a name, comment etc. I want to be able to display all this information, and other things like date (of upload) and filesize.
Should I include these last two variables in my database as well, or should I call the php-functionsfilesize() andfilemtime() on the files when I need them? What are the (dis)advantages?
Thanks,
Pieter

People are also looking for solutions to the problem: javascript - Insert JS in PHP - on load scroll

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.