This code can be used to preview the image when we are uploading the image.
NOTE : There should be a folder called "imageUpload" in the root

Before selecting image


After selecting image


Image Preview

Controller


View