Introduction
Module aims to provide easy way to bind multipart forms using MongoDB GridFS feature for storing uploaded files. It does not write any temporary files, piping uploaded parts directly into gridfs instead (using gridfs-stream).
Implementation
For multipart request parsing it has a busboy-based implementation. Other implementations are welcome.
Usage
The module exports:
- BusboyParser - busboy-based parser implementation
- Form - Form binding implementation
A basic scenario
For the details, see tests.
// connection is a mongo connectiondriver is the mongoose moduleGrid = require 'gridfs-stream' require 'gridfs-form' grid = connectiondbdrivermongo // app is an express instance apppost '/upload' form = grid formbind req return resstatus500senderr if err resstatus200jsonbind;