travis js-standard-style npm downloads

This is based on connect-multiparty by Andrew Kelley.

It is express middleware for multiparty to process OpenRosa form submissions from ODK Collect following the OpenRosa FormSubmissionAPI spec.

The xml form submission is returned as req.body and any attached files are returned as req.files.

Incoming files are stored on disk in the tmp folder and must be cleanup up afterwards with something like:

req.files.forEach(function(file) {
    fs.unlink(file.path, function() {});


var openrosa = require('openrosa-form-submission-middleware');
var openrosaMiddleware = openrosa();

app.use('/submission', openrosaMiddleware);'/submission', function(req, res) {
  console.log(req.body, req.files);
  // don't forget to delete all req.files when done



Returns express middleware for receiving and processing OpenRosa form submissions.

  • options.maxContentLength sets the maximum content length of form submissions (defaults to 10Mb)

  • will redirect OpenRosa clients like ODK Collect to use https to send a submission (it does this by responding to the initial HEAD request from the client with a 204 with the Location headers set with the https protocol set)

Other options are passed directly on to multiparty.


See it on GitHub

Return to Code