N
N
NikSIk312019-10-26 11:07:29
Laravel
NikSIk31, 2019-10-26 11:07:29

Lots of download requests?

There are 2 parties that upload their files within the same entity. I made a conditional limit of 50MB (the sum of file sizes). So what's the best way to check the amount?
My files are loaded one by one and an entry is created in the database (it has a file size). Just because files are loaded one by one, then somehow calling a request with *get the amount where id...* is somehow not cool for every case.
Do you think it would be a good idea to make such a request once and put its result in cookies, and after adding the file, check the cookies and attribute there + the size of the downloaded file?
It I think will relieve of superfluous requests in a DB.
Or are there other ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2019-10-26
@Kostik_1993

No, cookies are not correct at all. Suppose you did on cookies. I opened it in another browser and downloaded another 50MB, and so on ad infinitum. Check from the database and don't worry, nothing bad will happen from one request

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question