I have the next code that works in chrome and firefox, however IE send ‘undefined’ message.
<input type="file" name="image" onchange="inputFileChange(this);"/>
function inputFileChange(el) {
console.log($(el).context.files);
}
This is the result of console.log in firefox and chrome.
FileList
0: File
lastModifiedDate: Thu Dec 20 2012 19:01:23 GMT-0600 (Hora estándar central (México))
name: "izq02_a.jpg"
size: 69767
type: "image/jpeg"
…and this is the result in IE
REGISTER: undefined
I need the filesize of the image before upload, any ideas?
IE10 has partial support for the file API, but earlier versions have none.
Here’s an old question on the topic. People have used Flash solutions as a workaround (well and as the only way possible before the File API existed).
You can use CanIUse to check on browser support for various things, as well as HTML5Please.