FileUpload control raises uncatchable error - htmlfile: Access is denied

Last Reply on May 14, 2012 06:11 AM By Mudassar

Posted on May 14, 2012 12:03 AM

Hi

I am having a File Uploader. In that, I am trying to assign the file uploader value to the text box. I did this in java script. But when I tried to hit the update button it leaves me an java script error saying Access is denied.

 

Can any one please help in this issue.

Thanks.

Posted on May 14, 2012 02:16 AM

It works fiine for me in FireFox, IE and Chrome

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        function SetValue() {
            document.getElementById("<%=TextBox1.ClientID %>").value = document.getElementById("<%=FileUpload1.ClientID %>").value;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:FileUpload ID="FileUpload1" runat="server" onchange = "SetValue()"  />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </form>
</body>
</html>

 


Posted on May 14, 2012 06:11 AM

I think you are confused. I'll make it clear

1. FileUpload does not work with UpdatePanels

2. FileUpload path is not available and cannot be made available in any way server side due to security

3. The path in FileUpload is client machine path and is no use on server hence I don't see any reason why you need it