In this process the image is selected first and previewed before storing it in to any location . Then using jQuery Ajax, it is send to php script on submit button event.
PHP script stores the image in a defined location and returns the message of the success and failure of the process.
Here we have applied some validations on the selected file, to check it whether it is an image file (jpg, jpeg or png ) or any other file type.
Upload File size allowed is 100 Kb.
Following steps are pointed under this process :
-
Include jQuery library.
-
HTML page with upload field.
-
jQuery Ajax code.
-
PHP script to store image.
Next step - update the values in the database using MySQL