is it possible to preview local images before uploading them via a form?

前端 未结 6 981
不思量自难忘°
不思量自难忘° 2020-12-02 21:07

To be more specific, I want to use a form with one or more file input fields used for images. When those fields are changed, I\'d like to show a preview of the associated im

6条回答
  •  庸人自扰
    2020-12-02 21:44

    You can try this approach, although it seems it doesn't work on IE.

    http://saravani.wordpress.com/2012/03/14/preview-of-an-image-before-it-is-uploaded/

    It's simple and fast to code.

    I put the code here just in case the source dies:

    Script:

        
        
    

    In the HTML:

        
        
        
          
          your image
        
    

提交回复
热议问题