We often allow our users to upload files to our server. It is important to limit file extensions that we accept.
For example, we need to only accept .pdf and .txt files from our users, we don’t want them to send us any other files instead of pdf and txt. Then this snippet is useful to check their file extension before accepting it:
https://thirteenov.ciihuy.com/checkin...
PS: Sorry I forgot to record my cursor in this video, haha.