0

I am trying to use the html input type=file element and get files from it using document.getelementbyid("..").files and it is working fine in chrome and firefox but not in IE 10. I've gone through alot of blogs and most suggest that IE 10 onwards support the File object but its not working for me in either IE 10 or IE 11. Can someone please help me out with this.

code:

HTML: <input type="file" id="fuAttachment" name="fuAttachment" class="mof-strip-file" style="width:68%;" />

Javascript: var inputfile = document.getElementById("fuAttachment").files[0]; –

hira
  • 141
  • 2
  • 2
  • 10
  • please share some relevant code in post so that we can help you better. – Bhushan Kawadkar Jun 24 '14 at 09:41
  • @hira Show me your code ?? – gjman2 Jun 24 '14 at 09:41
  • @hira Put your code as part of the question not as comment (Remove it from comment) – gjman2 Jun 24 '14 at 09:45
  • @hira Check your error console and try to go through this site maybe useful. http://msdn.microsoft.com/en-us/library/ie/hh673542%28v=vs.85%29.aspx – gjman2 Jun 24 '14 at 09:51
  • @gjman2 i have already been through that site with no help. I was hoping to find a workaround. – hira Jun 24 '14 at 09:56
  • @hira Ic, as I know IE == Problems. Btw can you give me the links of the blogs that said IE 10 onwards support the File object? – gjman2 Jun 24 '14 at 10:11
  • lol.. well it said so on w3c [link]http://www.w3schools.com/tags/att_input_type.asp – hira Jun 24 '14 at 10:39
  • @gjmann also this page is basically the api reference for File api for IE10 http://msdn.microsoft.com/en-us/library/ie/hh673542(v=vs.85).aspx#api_reference – hira Jun 24 '14 at 11:51
  • @hira try to debug your javascript code.Try to put alert("") in your javascript method then check in your error console. – gjman2 Jun 24 '14 at 12:14
  • @hira maybe useful http://stackoverflow.com/questions/16242072/html5-file-upload-form-with-customized-style-cant-fire-submit-button-using-ie10?rq=1 and this one http://stackoverflow.com/questions/16676945/dynamically-submitting-a-file-upload-form-in-ie10-using-jquery?rq=1 – gjman2 Jun 24 '14 at 12:23

1 Answers1

0

Thank you all for your help. Turns out that the ActiveX content filtering needed to be turned off in Internet Options > Security. First add your website as trusted site and then select "Custom Level" and then select Disable under ActiveX filtering.

hira
  • 141
  • 2
  • 2
  • 10