Filer is a simple but effective multipart form handler for Meteor. It utilizes Formidable to parse the supplied form;
The assumption is that requests will be sent with ajaxPosts therefore json objects are return on completion, failure or permission denied. See Filer.RespBody for the format.
##Example Usage:
Basic: uses the default options
Filer.register();
Custom:
var options = {uploadDir:'./public/'}
var filer = new Filer(options);
filer.events({
'file':function(field,value){// do something},
'FileBegin': function(name,file){// do something}
});
filer.allow(function(){
if(Meteor.userId()){
return true;
}
return false;
});
filer.register('/upload');
Exposed formidable options: See Formidable Docs for more details
Defaults:
encoding = 'utf-8';
uploadDir = process.env.TMP || process.env.TMPDIR || process.env.TEMP || '/tmp' || process.cwd();
keepExtensions = false;
maxFieldsSize = 2 * 1024 * 1024;
hash = false;
[Coming Soon]
Filer is licensed under the MIT license.
Felix Geisendörfer for his awesome formidable form parser
possibilities for node-modules
oortcloud guys for meteorite an installer & smart package manager for Meteor