Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

How to Upload and Compress an Image using PHP

Image compression is very helpful to reduce the size of the image. Generally, the user does not optimize the image when uploading through the website. In this case, compress images before upload to optimize the image.

So, now I am show you how to compress image before upload using PHP.

Create a PHP form with an input field and submit button. This <form>
tag contain following contain:

  • method=”post”
  • enctype=”multipart/form-data

Note: enctype=”multipart/form-data” is compulsory for image upload precess via post method in form.


After the form submission, the file data is submitted to the upload.php file for further processing. Then, compress and upload images in PHP.

The upload.php file handles the image compression upload operations. I have used some PHP image functions like compressImage() that helps to compress and save image on the server using PHP.

If the file is submitted, then retrieve the file info using the PHP $_FILES method, compressed size, and upload image using compressImage() function. Then see the image upload status.


Then, see the results: