Mahesh barge’s Weblog

Javascript error “Access is Denied” for asp:FileUpload June 17, 2008

Filed under: ASP.NET — maheshbarge @ 4:52 am

 Hi,

Run the simplest of file upload pages (see below). Type a non-existant filename into the file upload control (e.g.abcd) then, click the upload button.

The page throws an error (Access is denied) that is not caught by the standard error handling process, and occurs somewhere.

The page is as below:
<html>
 <script language=”JavaScript”>
 function doSubmit()
 {
     document.abc.submit();
     return true;
 }
 </script>
 <form method=”post” name=”abc” enctype=”multipart/form-data”>
   <td><input size=”32″ name=”importfile” type=”file”></td>
  <td><input value=”Submit” name=”submitbutton” onclick=”return doSubmit();” type=”button” ></td>
 </form>
</html>

Could you please let me know if this is an error of IE7 or there is a difference between IE6 and IE7 when handling this case?

Thanks and regards.

Mahesh B.