afterRender:
// Only works on HTML5
$('#file').on('change', function() {
$("#upload-package").prop("disabled", false);
var sizeLimit = 90;
if (this.files && this.files.length && this.files[0].size > sizeLimit*1024*1024) {
notifier.error_x("File size exceeds limit of "+sizeLimit+"MB");
$("#upload-package").prop("disabled", true);
return;
}
if (this.files && this.files.length && this.files[0].name && this.files[0].name.match(/makitox_dec_v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}-[0-9]{1,4}\.hai$/) === null) {
notifier.error_x(this.files[0].name + " is not a valid makitox decoder package");
$("#upload-package").prop("disabled", true);
return;
}
});
cleanup:
$('#file').off('change');
Recent Comments