I am trying to upload an image with collection fs package.This is my event code
'change .ip': function(event, template) {
FS.Utility.eachFile(event, function(file) {
Images.insert(file, function (err, fileObj) {
if (err){
// handle error
} else {
// handle success depending what you need to d
}
});
});
},
this is the html code in the template <input type="file" class="ip form-control" name="sn_edit" value="">
I have this code in my collections code called school.js
Images = new Mongo.Collection('images');
SchoolImages = new FS.Collection("SchoolImages", {
stores: [new FS.Store.GridFS('SchoolImages')]
});
Should i create the collection images myself or will meteor create it for me?.