Meteor cfs标准包-检查错误

Meteor cfs标准包-检查错误,meteor,upload,filesystems,Meteor,Upload,Filesystems,在尝试将文件上载到我的数据库时,我遇到了一个匹配错误,导致无法存储该文件 以下是基本代码: 初始化: UserImages = new FS.Collection("userImages", { stores: [new FS.Store.FileSystem("userImages", {path: "~/uploads"})], filter: { maxSize: 1048576, //in bytes allow: { contentTypes: ['

在尝试将文件上载到我的数据库时,我遇到了一个匹配错误,导致无法存储该文件

以下是基本代码:

初始化:

UserImages = new FS.Collection("userImages", {
  stores: [new FS.Store.FileSystem("userImages", {path: "~/uploads"})],
  filter: {
    maxSize: 1048576, //in bytes
    allow: {
      contentTypes: ['image/*'],
      extensions: ['png', 'jpg']
    },
    onInvalid: function (message) {
      if (Meteor.isClient) {
        alert(message);
      } else {
        console.log(message);
      }
    }
  }
});

if(Meteor.isServer){

    UserImages.allow({
        insert:function(userId, doc){

          return true;
        },
        update:function(userId, doc, fields, modifier){

          check(doc, Object);

          return true;
        },
        remove:function(){
          return true;
        }
      })
}
客户端代码:

Template.editProfile.events({
    'change #profileUpload':function(event, template){
        var files = event.target.files;
        for (var i = 0, ln = files.length; i < ln; i++) {

            UserImages.insert(files[i], function (err, fileObj) {
            if(err){
                console.log(err);
            }
            });
        }
    }
});
是否有人遇到此问题或有解决方法?我也尝试了Match.Any的各种解决方法,但是我得到一个错误,告诉我没有针对check()运行所有参数

我在这里检查了问题:

但目前还没有找到解决办法

谢谢你的帮助

Exception in setTimeout callback: Error: Match error: Expected plain object
     at checkSubtree (packages/check/match.js:279:1)
     at check (packages/check/match.js:32:1)
     at UserImages.allow.update (app/server/allowances.js:91:7)
     at packages/mongo/collection.js:1041:1
     at Array.every (native)
     at Function._.every._.all (packages/underscore/underscore.js:219:1)
     at [object Object].Mongo.Collection._validatedUpdate (packages/mongo/collection.js:1038:1)
     at [object Object].m.(anonymous function) (packages/mongo/collection.js:851:1)
     at Object.methods.rateLimit.callFunctionsInQueue (packages/matteodem:easy-security/lib/easy-security.js:72:1)
     at packages/matteodem:easy-security/lib/easy-security.js:116:1