A
A
Alexfixer2020-02-14 15:49:28
CodeIgniter
Alexfixer, 2020-02-14 15:49:28

How to limit the number of avatars uploaded to the server by the user?

How to limit the number of avatars uploaded to the server by a user?
Let's say you uploaded one, if you still try, the picture will be overwritten, and not loaded again.
b.d.
5e46a351b36f4947133837.jpeg
It turns out at me as: the user loads a picture. The image is placed in a folder on the images server. I get the name from the database and insert it into the img tag in the src attribute

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2020-02-14
@Alexfixer

If without a database, then when the avatar is loaded, rename the uploaded file, giving it the same name.
I don't know how you organize the storage of avatars, but for example:
'avatar_'. $userId
That is, each uploaded avatar will be called the same as the previous one. Respectively ,

The image will be overwritten, not reloaded.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question