Skip to content

Instantly share code, notes, and snippets.

@addisonj
Created May 26, 2011 18:13
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 addisonj/993686 to your computer and use it in GitHub Desktop.
Save addisonj/993686 to your computer and use it in GitHub Desktop.
connect-form issues
app.get('/upload', checkAuth, function(req, res) {
res.render('upload');
});
app.post('/upload', checkAuth, function(req, res) {
console.log('Got Here');
req.form.complete(function(err, fields, files) {
if (err) {
throw new Error('Upload failed');
} else {
console.log(files);
res.redirect('/upload');
}
});
});
[addisonj@ungeheuer:Projects/sasBatch]$ cat views/upload.jade (05-26 12:12)
h2 New File
form(method='post', action='/upload')
label File:
input(type='file', name='File1')
input(type='submit', name='Submit')
[addisonj@ungeheuer:Projects/sasBatch]$ npm list (05-26 12:11)
/home/addisonj/Projects/sasBatch
├── async@0.1.9
├── cas@0.0.1
├─┬ connect@1.4.1
│ ├── mime@1.2.2
│ └── qs@0.1.0
├─┬ connect-form@0.2.1
│ └── formidable@1.0.2
├─┬ connect-mongodb@0.3.0
│ ├─┬ connect@1.4.1
│ │ ├── mime@1.2.2
│ │ └── qs@0.1.0
│ └── mongodb@0.9.4-3
├── connect-timeout@0.0.1
├─┬ express@2.3.4
│ ├── connect@1.4.1
│ ├── mime@1.2.2
│ └── qs@0.1.0
├── express-messages@0.0.2
├── jade@0.10.7
├── mongoose@1.3.3
└── nexpect@0.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment