Meteor autoform-file not working -


i'm trying autoform-file working (https://github.com/yogiben/meteor-autoform-file), doesn't seem doing @ all.

as per quick start, i've done following:

1) defined collection right permissions:

images = new fs.collection("images", {     stores: [new fs.store.filesystem("images", {path: "~/meteor_uploads"})] });  images.allow({     insert: function (userid, doc) {         return true;     },     download: function (userid) {         return true;     } });  

2) published collection:

meteor.publish('images', function () {      meteor.images.find({}); }); 

3) updated router wait subscription:

router.route('/test', {     waiton: function () {         meteor.subscribe('images');     },     action: function () {         this.render('test', {to: 'main'});     } });  

4) defined schema:

test.attachschema(new simpleschema({   username: {     type: string,     label: "title",     max: 100   },   userimg: {     type: string,     autoform: {       affieldinput: {         type: 'fileupload',         collection: 'images',         label: 'upload file'       }     }   }, })); 

5) used quickform in 'test' template:

{{> quickform collection="test" type="insert"}} 

the quickform displays in template button saying 'upload @ file' defined in schema. when click button can browse , click file in local filesystem. however, when click submit button in quickform, error saying "user img required".

this baffling me. i've followed steps (i think) in quick start , yet it's not doing @ all... have idea i'm going wrong?

turns out cfs:filesystem package doesn't work autoform-file. changed gridfs , it's working fine now.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -