We can not allow users to upload any files and any images to our server, we need to make rule, for example we don't allow them to upload an image bigger than 1mb/2mb or image that its width is more than 512px.
Here with this script we can prevent users to upload excessive big files and images. So before we store their image in our server, we compress them to an appropriate size.
Get the source code from my blog page: https://thirteenov.ciihuy.com/upload-...
On this page of the site you can watch the video online Upload and resize or compress image with PHP before storing on server with a duration of hours minute second in good quality, which was uploaded by the user ThirteeNov 11 August 2020, share the link with friends and acquaintances, this video has already been watched 2,538 times on youtube and it was liked by 36 viewers. Enjoy your viewing!