I have an asp.net AsynFileUpload control on the page and an html image tag that fires the AsyncFileUpload click event. Works fine in Firefox, Chrome and Safari but not IE.
**Example**
<script type="text/javascript">
function GetFile() {
document.getElementById("<%=AsyncFileUpload1.ClientID %>").click();
}
</script>
<ajaxToolkit:AsyncFileUpload runat="server" ID="AsyncFileUpload1" />
<img id="flImage1" src="images/upload.png" onclick="GetFile()" />
** End Example **
The uploader works fine in IE if I just use the uploader control. But I need an image on the page that will fire the uploader control click event.
When I click the image that fires the JavaScript GetFile() function, it then calls the click event for the AsynFileUpload control. I can then select my file for upload. Once I select the file I get a JavaScript alert "Access is denied".
**Example**
<script type="text/javascript">
function GetFile() {
document.getElementById("<%=AsyncFileUpload1.ClientID %>").click();
}
</script>
<ajaxToolkit:AsyncFileUpload runat="server" ID="AsyncFileUpload1" />
<img id="flImage1" src="images/upload.png" onclick="GetFile()" />
** End Example **
The uploader works fine in IE if I just use the uploader control. But I need an image on the page that will fire the uploader control click event.
When I click the image that fires the JavaScript GetFile() function, it then calls the click event for the AsynFileUpload control. I can then select my file for upload. Once I select the file I get a JavaScript alert "Access is denied".