Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Last active August 29, 2015 14:08
Show Gist options
  • Save aaronthorp/53d42eab37a390475acf to your computer and use it in GitHub Desktop.
Save aaronthorp/53d42eab37a390475acf to your computer and use it in GitHub Desktop.
CFS FileSystem
FS.TempStore.Storage = new FS.Store.FileSystem("_tempstore", {
internal : true,
path : '/mnt/data/tmp',
});
SpreadsheetFS = new FS.Collection("spreadsheets", {
stores: [new FS.Store.FileSystem("spreadsheets", {path: "/app-storage/uploads"})],
filter: {
allow: {
contentTypes: [
'application/vnd.ms-excel',
'application/msexcel',
'application/x-msexcel',
'application/x-ms-excel',
'application/x-excel',
'application/x-dos_ms_excel',
'application/xls',
'application/x-xls',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
]
}
}
});
SpreadsheetFS.allow({
insert: function(userId, doc) {
if (userId)
return true;
else
return false;
},
update: function(userId, doc, fields, modifier) {
if (userId)
return true;
else
return false;
},
remove: function(userId, doc) {
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment