code: function (filename, types) {
      types = types.split(',');
      var pattern = '\.(';
      for (var i = 0; i < types.length; i++) {
          if (0 != i) {
              pattern += '|';
          }
          pattern += types[i].trim();
      }
      pattern += ')$';
      return new RegExp(pattern, 'i').test(filename);
  }
docs: 判断是否自定类型的文件
  
  @param {String}filename
  @param {String}types, 多个类型使用,号分隔，如 doc,docx,txt
  @return {Boolean} true or false
  @api public