Thursday, 18 September 2014

How to Upload Image using jQuery with progress in PHP

How to Upload Image using jQuery with progress in PHP

We received many requests from our readers to write some tutorial on upload image with jQuery and show progress bar so here it is, in this tutorial we are using ajax form library to upload image and show a progress in percentage (%) after complete upload show that image on page. Image will be saved on server for that we used PHP coding.
How to Upload Image using jQuery with progress in PHP
index.php
This file Contains html form to upload image
jQuery libraries required to process:
Main jQuery code for upload file and progress bar:
Styling Progress bar
Used CSS for styling of progress bar.
processupload.php
Contains back end server side script to handle image and move to uploads directory after adding random number in file name.
$Destination = ‘uploads’ is destination folder and after changing we used move_uploaded_file function to move file from temporary location to uploads directory and after that show this image on page.
Upload form all together
This is the complete file code with jquery and css.
Feedback
If you have any issue in its configuration or want to suggest some thing please feel free to comment. For your ease we make its demo and script to download.

No comments:

Post a Comment