Skip to content

Instantly share code, notes, and snippets.

@diversario
Created September 27, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diversario/1245752 to your computer and use it in GitHub Desktop.
Save diversario/1245752 to your computer and use it in GitHub Desktop.
connect-formaline example
var connect = require('connect'),
UPLOAD_LIMIT = 1000000,
flconf = {"uploadRootDir": '/tmp/', "requestTimeOut": 600000, "resumeRequestOnError": false, "maxFileSize": UPLOAD_LIMIT, "checkContentLength": true, "holdFilesExtensions": true, "removeIncompleteFiles": true, "logging": 'debug:off,1:on,2:off,3:off,4:off,console:on,file:off,record:off'},
formaline = require('connect-formaline');
connect(
connect.cookieParser(),
connect.session({ secret: 'keyboard cat' }),
formaline(flconf),
function(req, res){
if (req.method == 'POST'){
req.form.on( 'loadend', function(json, res, cb){
console.log('loadend', json);
res.end();
});
}
}).listen(80);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment