liferay 6 - Not able to get file object Using YUI IN Internext Explorer -
i trying upload file using yui. below code works fine in firefox , chrome.but not working in ie 8.
this.portlet_view_object.delegate('change', function(e) { ...... var filefield = y.one('#newcase_file_'+context.imagecount); var file = filefield._node.files[0]; if(!context.maxfilesize.call(context,file)){ return; } ....
here, maxfilesize, method pass file object , perform operation related fiel(e.g. filesize, filename). in firefox , chrome, getting file object filefield._node.files[0]; same thing not working in ie 8,and getting below error. _node.files.0' null or not object
any suggestions welcomed.
thanks.
this issue isn't related yui, ie.
.files
holds multiple selected files, ie8 not support methos , can select 1 file. therefore property isn't recognized.
you can use workaround:
if ('files' in filefield._node) var file = filefield._node.files[0]; else var file = filefield._node.value;
or skip whole .files
if want to, although wouldn't recommend it.