It looks like you're new here. If you want to get involved, click one of these buttons!
'onselect' : function(event,queueID,fileObj){
var fileName = fileObj.name;
var ext = FileName.substring(fileName.lastIndexOf(".")+1,fileName.length); // Extract EXT
switch (ext) {
case 'xls':
case 'txt':
alert('filetype ok');
break;
default:
alert('filetype not ok');
$jQuery('#queue').uploadifyCancel(queueID);
break;
}
}
'onAddQueueItem' : function(file){
var fileName = file.name;
var ext = FileName.substring(fileName.lastIndexOf(".")+1,fileName.length); // Extract EXT
switch (ext) {
case 'xls':
case 'txt':
alert('filetype ok');
break;
default:
alert('filetype not ok');
$('#file_upload').uploadifive('cancel', file);
break;
}
}
<form>
<div id="queue"></div>
<input id="file_upload" name="file_upload" type="file" multiple="true">
<a style="position: relative; top: 8px;" href="javascript:$('#file_upload').uploadifive('upload')">Upload Files</a>
</form>
<script type="text/javascript">
$(function() {
$('#file_upload').uploadifive({
'auto' : false,
'dnd' : true,
'queueID' : 'queue',
'uploadScript' : 'uploadifive.php',
'onAddItemQueue' : function(file) {
alert('The file ' + file.name + ' was added to the queue!');
}
});
});
</script>
'onAddQueueItem' : function(file){
var fileName = file.name;
var ext = fileName.substring(fileName.lastIndexOf('.') + 1); // Extract EXT
switch (ext) {
case 'xls':
case 'txt':
alert('filetype ok');
break;
default:
alert('filetype not ok');
$('#file_upload').uploadifive('cancel', file);
break;
}
}
}