首页 > autoform + collection2实现上传失败

autoform + collection2实现上传失败

   aldeed:collection2
   cfs:standard-packages
   cfs:gridfs
   aldeed:autoform
<template name="profile">
{{#autoForm collection='Links' type='insert' id='insertLinksForm'}}
  <fieldset>
    {{> afQuickField name='title'}}
    {{> afQuickField name='picture'}}
    <button type="submit" class="btn btn-primary">insert</button>
  </fieldset>    
{{/autoForm}}
</template>
//stores:[]
var Images = new FS.Collection("images",{
  stores:[new FS.Store.GridFS('imagesStore',{path:'~/uploads'})]
}

)
Images.allow({
  insert: function(userId, doc) {
    return true;
  },
  update: function(userId, doc, fieldNames, modifier) {
    return true;
  },
  download: function(userId) {
    return true;
  }
});`
Schemas = {};
//将Meteor.Collection改为Mongo.Collection,由于meteor版本的升级
var Links = new Mongo.Collection('links');
Schemas.Links = new SimpleSchema({
  title:{
    type:String,
    max:60,
  },
  picture:{
    type:String,
    autoform:{
      afFieldInput:{
        type:'fileupload',
        collection:'Images',
        label:'上传'
      }
    }

  }
})
Links.attachSchema(Schemas.Links);
Links.allow({
  insert:function () {
    return true;
  }
})
Meteor.publish('images', function() {
  return Images.find({});
});
Meteor.publish('links',function () {
  return Links.find({})
})

求大神解答?

【热门文章】
【热门文章】