0

I have input with id case_attachment and I have tried get file size like this

($('#case_attachment'))[0].files[0].size

but it does not work on IE9

1 Answer 1

1

IE doesn't support this feature :(

I had found a great plugin for file upload jQuery-File-Upload

or you better use an ActiveX control to perform this action

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");
}

source: http://www.sencha.com/forum/showthread.php?196859-File-Upload-Field-IE-Safari-Opera-fileInput-error.&s=b124834725ae363759158268d91ac32c

Sign up to request clarification or add additional context in comments.

2 Comments

I have tried like this but it give an error "Automation server can't create object"
The error "Automation Server Can't Create Object" means that your browser's security settings are too low for the ActiveX control to run. You have to move your page into the trusted sites list and lower the ActiveX settings so it can run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.