Skip to content

aheckmann/connect-multipart-gridform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#connect-multipart-gridform

Connect compatible multipart middleware configured to stream uploads directly to MongoDB GridFS.

install

npm install connect-multipart-gridform

use

var multipart = require('connect-multipart-gridform');
app.use(multipart(options));

options

Options work the same way as in the connect multipart middleware, with these additions:

The optional filename function is passed the file.name before streaming to MongoDB providing an opportunity to customize the filename with a prefix etc.

For the curious, the options are first passed into a gridform before passing on to connects multiple middleware.

why?

Connect multipart middleware uses formidable to process file uploads. formidable streams the files to disk. Now you can stream directly into GridFS.

dependencies

connect-multipart-gridform utilizes both the gridform and connect multipart modules which are directly exposed as:

var multipart = require('connect-multipart-gridform');
var gridform = multipart.gridform;
var connectMultipart = multipart.multipart;

tests

Run the tests with make test.

express

Currently only works with Express 3.

example

https://github.com/aheckmann/connect-multipart-gridform/tree/master/examples

LICENSE

About

Connect multipart middleware configured to use MongoDB GridFS for file storage.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •