I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image.
How can I do this?
I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image.
How can I do this?
What about this solution?
Just add the data attribute "data-type=editable" to an image tag like this:
And the script to your project off course...
See demo at JSFiddle
How about creating a function that loads the file and fires a custom event. Then attach a listener to the input. This way we have more flexibility to use the file, not just for previewing images.
Probably my code isn't as good as some users but I think you will get the point of it. Here you can see an example
It's my code.Support IE[6-9]、chrome 17+、firefox、Opera 11+、Maxthon3
HTML
javascript:
For Multiple image upload (Modification to the @IvanBaev's Solution)
http://jsfiddle.net/LvsYc/12330/
Hope this helps someone.
I have made a plugin which can generate the preview effect in IE 7+ thanks to the internet, but has few limitations. I put it into a github page so that its easier to get it
Please take a look at the sample code below:
Also, you can try this sample here.