Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: b09c025bdd
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (23 sloc) 0.863 kB

Connect Form

Connect Form is a multipart / urlencoded form parsing middleware utilizing node-formidable behind the scenes.

Installation

via npm:

$ npm install connect-form-sync

Example

checkout https://github.com/anatoliychakkaev/railway-example-upload

files_controller.js:

action('create', function () {
    this.file = new File();
    var tmpFile = req.form.files.file;
    this.file.upload(tmpFile.name, tmpFile.path, function (err) {
        if (err) {
            console.log(err);
            this.title = 'New file';
            flash('error', 'File can not be created');
            render('new');
        } else {
            flash('info', 'File created');
            redirect(path_to.files);
        }
    }.bind(this));
});
Jump to Line
Something went wrong with that request. Please try again.