I'm trying to show an image, before saving it in the bank, in an image field. The following is an attachment that I'm using:
<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 here 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 an error, but does not load the image, I would like to open FileUpload and select the image, it appears in the Image field, so the user can see the image, and then save it, the save part is working already. Thank you.