Reputation: 45
I'm using the control FileUpload to choose an image and upload but now I want to display a preview of the chosen image before saving the image, just to give the user an output of the chosen image.
I googled but could not find an answer for that.
Upvotes: 0
Views: 1444
Reputation: 3968
The problem is you have to upload the image to your server to you can display(serve) it. I did some searching, and found this question: How to show local picture in web page? - and I was thinking, if you have the local path of the image, why not use some ajax to pop the url in a simple img tag.
However, you can't even link to a local image anymore, due to security. So for your application to show a preview of the image you would have to first have the image to display it, and the upload would have to occur first.
Upvotes: 1