UploadiFive 1.2.2';文件类型';过滤器功能/限制不起作用


UploadiFive 1.2.2 'fileType' filter capability/restriction does not work

我尝试了许多不同的建议,包括上传论坛上的建议:http://www.uploadify.com/forum/#/discussion/8232/upload-5-html-5-文件类型-可替换性/p1

但这些似乎并没有限制用户更改文件类型。有什么想法吗?这是我下面的代码:

<script type="text/javascript">
<?php $timestamp = time();?>
$(function() {
    if ($('#fileupload').length > 0) {    
      $('#fileupload').uploadifive({
        'auto'             : true,
        'checkScript'      : '../home/assets/uploadifive/check-exists.php',
        'formData'         : {
                     'timestamp' : '<?php echo $timestamp;?>',
                     'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                             },
        //'queueID'          : 'queue',
        'uploadScript'     : '../home/assets/uploadifive/uploadifive.php',
        'multi'    : false,
        'removeCompleted' : false,
          'fileSizeLimit' : '3MB',
          'uploadLimit'  : 1,
          'buttonText':'Select File',
           onSelect: function() {
               $('#btn_submit').attr({disabled: true, value:'Uploading...' }).css( "background-color", "#707070" );
               },
           onUploadComplete: function(file,data,reponse) {
               $('#uploadedfile').val(data);
                 $("#btn_submit").attr({disabled: false, value:'Register' }).css( "background-color", "#D4D0C8" );
                 alert('The file ' + file.name + ' was successfully uploaded ');
        },
       // 'fileType'     : 'application/pdf|application/doc|application/docx'     //not 
                                                                                 //working.
       // 'fileType'     : ["gif","jpeg","png"]   //not working.
       // 'fileType'     : 'image/png|image/jpg' //not working.
       // 'fileType'     : 'image/*'    // works but does not restrict user from changing 
                                        // it something else.
       // 'fileType': ["image'/jpeg","image'/png"]  // works but does not restrict user   
                                                    // from changing it something else.       
      });
    }
});
</script>

这里也有同样的问题。我已更改"fileType":"image",它允许整个img文件,但不允许其他文件(抛出禁止的文件类型错误(Php我添加了$fileTypes=数组('jpg','jpeg','gif','png'(;允许的文件扩展名所以我们只能过滤jpg gif和png文件。但它会增加上传的文件数uploadify。

我在一个线程上找到了这个答案,但它适用于v1.0*我不确定他们是否已经为1.2.2修复了它更改第283行的源JS(jquery.uploadifive-v.0.JS(以使其正常工作,并接受我的fileType数组。

var v = 0;
                            for (var n = 0; n < settings.fileType.length; n++) {
                                if (file.type.indexOf(settings.fileType[n]) > -1) {
                                    v += 1;
                                }
                            }
                            if (v < 1) {
                                $data.error('FORBIDDEN_FILE_TYPE', file);
                            }

我已经尝试过传递数组以及|分隔的文件扩展名,但它仍然不起作用。