Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openrosa-form-submission-middleware

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openrosa-form-submission-middleware

Express middleware for receiving OpenRosa xform submissions

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
increased by44.44%
Maintainers
2
Weekly downloads
 
Created
Source

OpenRosa FormSubmissionAPI middleware

Build Status

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() {});
});

Usage

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

app.use('/submission', openrosaMiddleware);

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

If you pass options to openrosa(), they are passed directly into multiparty.

Keywords

FAQs

Package last updated on 27 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc