Is there any way to display image in client browser without uploading it to server?

后端 未结 4 565
攒了一身酷
攒了一身酷 2021-01-24 01:57

I am writing a simple \"Book\" create page in ASP.NET MVC. User can create book by filling title,year etc.. and selecting a cover image. When user press \"Create\" button Form

4条回答
  •  春和景丽
    2021-01-24 02:27

    Yes, you can using javascript

    Javascript:

    function showThumbnail(files){
      for(var i=0;i

    HTML:

    
    

    You just need the input field and The div to display the thumbnail image, and on change for the input field will call showThumbnail function which will append img inside the "thumbnail" div.

提交回复
热议问题