-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestRepo.js
48 lines (41 loc) · 977 Bytes
/
testRepo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
if (Meteor.isClient) {
Template.index.events({
'change input[type=file]': function(event, template) {
FS.Utility.eachFile(event, function(file) {
var fsFile = new FS.File(file);
console.log("Inserting FS file", fsFile);
Images.insert(fsFile, function(err, fileObj) {
if (err) {
console.error(err);
}
console.log("Inserted file", fileObj);
});
});
}
});
Template.index.helpers({
images: function() {
return Images.find();
}
});
Meteor.subscribe('pictures');
}
if (Meteor.isServer) {
Meteor.publish("pictures", function() {
return Images.find();
});
Images.allow({
insert: function(userId, doc) {
return true;
},
download: function(userId, fileObj) {
return true;
},
update: function(userId, doc, fields, modifier) {
return true;
},
remove: function(userId, doc) {
return true;
}
});
}