title: getting access is denied error on IE8
body: <p>I have a HTML form (<strong>upload.htm</strong>) with a HTML file upload control inside of it.</p>
  
  <pre><code>&lt;form id="frmupload" name="upload" enctype="multipart/form-data" action="uploadhandler.ashx" method="post"&gt;
      &lt;input id="uploader" name="uploadctrl" type="file"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>There is also one JavaScript method in the above page which goes like:</p>
  
  <pre><code>function performUpload(){
      document.getElementById('frmupload').submit();
  }
  </code></pre>
  
  <p>I call this inside of a page (<strong>uploadpage.htm</strong>) from within an <code>iframe</code>:</p>
  
  <pre><code>&lt;iframe id="docframe" src="upload.htm" style="display:none"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>I try to execute the statement shown below from the <strong>uploadpage.htm</strong> page:</p>
  
  <pre><code>var i = document.getElementById('docframe');
  i.contentWindow.performUpload();
  </code></pre>
  
  <p>I get an error saying <em>Access is denied</em>, and my debugger halts at the first JavaScript function I've shown. Both the files are in the same location in the web project. They have the same domain name too. Why do I get this error then?</p>
  
  <p>Of course, earlier, I could post the page: when I did not set the <code>name</code> attribute for the HTML upload control. But after I set the name attribute in HTML markup, I get this weird error. Why didn't I get this the first time?</p>
  
  <p>Had a look @ this post --> <a href="https://stackoverflow.com/questions/2276374/access-is-denied-when-script-tries-to-access-iframe-in-ie8">&quot;Access is denied&quot; when script tries to access iframe in IE8</a>, but it didn't help.</p>