3

Hello I am looking for a Javascript or jQuery based solution to show an image preview of the SELECTED image and not of the uploaded one. So as soon as the user selects the image a preview will be shown of this image. I do not have any code, I am pretty lost here. I need a solution HTML + Javascript or jQuery based. I can also use some PHP if necessary

DiegoP.
  • 42,459
  • 34
  • 85
  • 101
  • 2
    [How to upload preview image before upload through JavaScript](http://stackoverflow.com/questions/4094012/how-to-upload-preview-image-before-upload-through-javascript) This should be able to help you out. – Bill Criswell Jul 19 '11 at 16:27

1 Answers1

5

To do that, you need to use the HTML5 File API. Almost every latest browsers support this feature except IE9. Safari 5.1 supports this but it's still in beta. You can check the HTML5 File API browser compatibility here.

There are good tutorials about using the HTML5 File API to display preview like this or this.

If you need more, you can find more with googling. You may need to use Progressive enhacement.

Sanghyun Lee
  • 17,726
  • 18
  • 88
  • 118