1
I’m trying to show an image, before saving it in the bank, in an image field. The function I am using is attached:
<script type="text/javascript">
function mostraImagem() {
var imagem = document.getElementById("imgImage");
var diretorio = document.getElementById("FileUpload1").value;
var teste = diretorio.split("\\");
imgImage.src = teste[3];
}
</script>
And this is Fileupload where I call the function:
<asp:Label ID="Label118" runat="server" Text="Vista Anterior" Font-Bold="True"></asp:Label>
<span class="ImagemAv" runat="server">
<asp:FileUpload ID="FileUpload1" runat="server" onChange="mostraImagem()"/><br />
<asp:Image ID="imgImage" runat="server" />
It does not return error, but does not load the image, would like when opening Fileupload and selecting the image, it appeared in the Image field, for the user to see the image, and then after it saved, the save part is working already. Thank you.
It worked perfectly Lucas, thank you!
– Mariana