valums/file-uploader — Issue #233: Exposed Cancel and IE 7 issue
Author: negativefix
Created: 2012-01-01 09:15:43+00:00
State: open

var uploader = new qq.FileUploaderBasic({
button: document.getElementById('file'),
action: 'php.php',
multiple: false,
allowedExtensions: ['jpg', 'png', 'jpeg'],
debug: true,
onSubmit: function(id, filename){
//console.log('Submit'+filename+ ' ' +id);
$('#progress').show();
$('#browse').hide();
$('#form-cancel').html('

')
},
onProgress: function(id, filename, loader, total){
console.log('Progress'+loader+ ' ' + total);

},
onComplete: function(id, filename, responseJSON){
$('#progress').hide();
$('#complete').show();
$('#form-cancel').empty();
},
onCancel: function(id, filename){
//console.log('Cancel');
$('#browse').show();
$('#complete, #progress').hide();
$('#form-cancel').empty();
}
});

$('#cancel-button').live('click', function(e){
e.preventDefault();
var id = $('#cancel-button').attr('rel');
//console.log(id)
uploader.cancel(id);
})

Above code runs just fine on IE8 and IE9/Chrome etc. but when it comes to IE7 it gives an error SCRIPT5007: Unable to get value of the property 'value': object is null or undefined, fileuploader.js line 982 character 6. It seems IE can't access the value of input field when getName method is fired.

I downloaded the uploader from jeremywiebe's fork at :https://github.com/jeremywiebe/file-uploader.