jQuery-File-Upload icon indicating copy to clipboard operation
jQuery-File-Upload copied to clipboard

file.size is undefined in Internet explorer 9

Open jcorreia opened this issue 15 years ago • 9 comments

Hi, I´m using your index.html from the example and noticed that file.size in undefined in IE9. In firefox 5 it works well.

Here is how I´ve discovered

$('#fileupload').bind('fileuploadadd', function (e, data) { 

    $.each(data.files, function (index, file) {

               console.log(file.name);
               console.log(file.size);

How can we fix it ? Thanks

jcorreia avatar Jul 05 '11 12:07 jcorreia

Please have a look at the updated browser support page: https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support

blueimp avatar Jul 05 '11 18:07 blueimp

Hi, Thanks, but it says there in "File meta data" that, "Internet Explorer only reports the file name." "...... PRIOR to uploading files:" Which explains my problem with call "fileuploadadd", but isn´t callback "fileuploaddone" AFTER uploading file ? I´ve checked and it doesn´t work with "fileuploaddone" also.

Thanks

jcorreia avatar Jul 06 '11 08:07 jcorreia

How can I reopen this issue ? it seems I dont have permission...

jcorreia avatar Jul 06 '11 09:07 jcorreia

The data.files property won't change from add to done callback (the file elements will still only hold the name property in IE), however, after uploading files it depends on what information the server returns - thus IE can also display the filesize if the upload handler returns this information as part of the response (data.result).

blueimp avatar Jul 06 '11 09:07 blueimp

ok, thanks

jcorreia avatar Jul 06 '11 10:07 jcorreia

I hate to say it, but how does Gmail accomplish this in IE9? Somehow they're able to retrieve the filesize.

thapar avatar Apr 21 '12 12:04 thapar

IE exposes a fileSize property for document and img elements, but as far as I know, there is no way to access the size of selected files (via a file input element) in IE via JavaScript. So I guess, Gmail makes use of ActiveX or another plugin or they're using a technique that I'm not aware of.

blueimp avatar Apr 21 '12 17:04 blueimp

Very interesting, thanks for the insight Sebastian

thapar avatar Apr 21 '12 18:04 thapar

If you have a moment, btw, I'd really appreciate if you could take a glance at https://github.com/blueimp/jQuery-File-Upload/issues/1227 , since I'm kind of at a standstill until I get that resolved. Thanks!

thapar avatar Apr 21 '12 18:04 thapar