javascript - Preview an image from a form on another page before it is uploaded -
javascript - Preview an image from a form on another page before it is uploaded -
just quick question. i'm stuck trying find out if possible have form user can come in info product. i'm saving info entered user in session variable. when user hits submit button form doesn't submit database takes them review page. user can review entered details , 1 time happy finalise new page. user can select file(image) in first form need display image on sec page.(review page)
i know code display image 1 time user selects file. how, if possible, can display image on sec page?
js
function readurl(input) { if (input.files && input.files[0]) { var reader = new filereader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result); } reader.readasdataurl(input.files[0]); } } $("#imginp").change(function(){ readurl(this); });
html
<form id="form1" runat="server"> <input type='file' id="imginp" /> <img id="blah" src="#" alt="your image" /> </form>
so said, show image user selects file, need utilize
<img id="blah" src="#" alt="your image" />
on sec page?
any ideas? 1000000 in advance
peter
well,question seems have more 1 ideas @ once
you can not store @ client side first,you can store image temp folder , if utilize confirms submissions re-create main folder also,second
you can convert image base64 or byte session , display converting values image , create sure sessions getting null after submission of user
i sharing link help accomplish
http://stackoverflow.com/a/12396875/2630817
storing image path in variable
javascript php jquery html
Comments
Post a Comment