4

I have tried a lot but did not find any way to solve my problem.

How to get size of uploaded file in IE8,9 ?

Onkar Janwa
  • 3,892
  • 3
  • 31
  • 47

1 Answers1

2

You will need to use Active X as those versions of IE do not support the HTML5 File API. I found a code snippet on the web that does that.

function getSize()
{
    var myFSO = new ActiveXObject("Scripting.FileSystemObject");
    var filepath = document.upload.file.value;
    var thefile = myFSO.getFile(filepath);
    var size = thefile.size;
    alert(size + " bytes");
}

Refer this for details. Also take a look at the Remarks Section in the API Reference of IE for |input type=file| here.

Abhishek Potnis
  • 837
  • 8
  • 18