Posts

Showing posts from May, 2018

How to reduce or compress image size while uploading using PHP

It is very common to upload images to the server or website by the users and admins. Users mostly upload their images for setting their profile picture or to submit documents and so on. But most of the time images are uploaded by the users are not optimized for the web, thus taking much more spaces on your server than that it actually need. Apart from this when you upload an image of large size, it takes more time to load on the web page, thus its effects on your website ranking. Uploaded images are very important and it should be reduced as much as possible. You can write some PHP code that reduces or compress image size while uploading to the server. But, of course reducing the image size will also reduce the image quality.  So, in this tutorial, I will show you how to reduce or compress image size while uploading using PHP. How to reduce or compress image size while uploading using PHP Step 1: Image Upload Form (index.php): <form method="post" enctype="mul