Trending News
Home / Web Development / Ajax / Ajax Upload and Resize an Image with PHP

Ajax Upload and Resize an Image with PHP

Hi Guys,
Today I am presenting the most important social networking feature called ajax upload and resize an image without refreshing the page using PHP and jquery.


This article contains three folders called js,includes and uploads with PHP files.

  • includes
    — getExtension.php
    — compressImage.php
  • js
    — jquery.min.js
    — jquery.form.js
  • uploads

We can upload the image through PHP page. And resize the uploaded image using Ajax in php page.

Javascript Code


Contains simple PHP and HTML code. Here $session_id=1 means user id session value.


Upload image:




Contains PHP code. This script helps you to upload images into uploads folder. Image file name rename into timestamp+session_id.extention


Re-sizing image into different pixel dimensions.


This extracts file extension.


If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Loading Facebook Comments ...
Social Media Auto Publish Powered By :