just a quick question. I'm stuck trying to find out if this is possible but what I have is a form that a user can enter information about a product. I'm saving the information entered by the user in a session variable. When the user hits the submit button the form doesn't submit it into the database but it takes them to a review page. The user can then review their entered details and once happy they will finalise it from that new page. The user can select a file(image) in the first form which I need it to display as an image on the second page.(review page)
I know this code will display an image once the user selects a file. But how, if possible, can I display this image on the second 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 like I said, this will show the image as soon as the user selects the file, but I need to use
<img id="blah" src="#" alt="your image" />
on the second page?
Any ideas? A million thanks in advance
Peter
Well,Question seems to have more then one ideas at once
You can not store this at the client side So First,You can store that image into a temp folder and the if use confirms his submissions then copy into your main folder Also,Second
you can convert this image into a base64 or byte to session and then display by converting this values to image and make sure that this sessions getting null after submission of user
I am sharing you a link which will help you to accomplish