Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (23 sloc) 0.863 kb
7ba9a2e @tj Docs
tj authored
1
2 # Connect Form
3
4 Connect Form is a multipart / urlencoded form parsing middleware utilizing [node-formidable](http://github.com/felixge/node-formidable) behind the scenes.
5
04a9838 @tj Install docs
tj authored
6 ## Installation
7
8 via npm:
9
cb31cb0 @1602 Describe usage in readme
1602 authored
10 $ npm install connect-form-sync
04a9838 @tj Install docs
tj authored
11
12 ## Example
7ba9a2e @tj Docs
tj authored
13
cb31cb0 @1602 Describe usage in readme
1602 authored
14 checkout https://github.com/anatoliychakkaev/railway-example-upload
15
16 files_controller.js:
17
18 action('create', function () {
19 this.file = new File();
20 var tmpFile = req.form.files.file;
21 this.file.upload(tmpFile.name, tmpFile.path, function (err) {
22 if (err) {
23 console.log(err);
24 this.title = 'New file';
25 flash('error', 'File can not be created');
26 render('new');
27 } else {
28 flash('info', 'File created');
29 redirect(path_to.files);
30 }
31 }.bind(this));
32 });
Something went wrong with that request. Please try again.