How to use the formidable/lib/multipart_parser.js.MultipartParser function in formidable

To help you get started, we’ve selected a few formidable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yaronn / ws.js / lib / handlers / client / mtom / mime-reader.js View on Github external
parse_multipart: function(payload, boundary) {
    var parts = []
    var part
    var data
    var headers = []
    var curr_header_name
    var curr_header_value

    var parser = new MultipartParser()
    parser.initWithBoundary(boundary)

    parser.onPartBegin = function() {
      part = {}
      headers = []
      curr_header_name = ""
      curr_header_value = ""
      data = new Buffer('')
    }

    parser.onHeaderField = function(b, start, end) {
      curr_header_name = b.slice(start, end).toString()
    };

    parser.onHeaderValue = function(b, start, end) {
      curr_header_value = b.slice(start, end).toString()

formidable

A node.js module for parsing form data, especially file uploads.

MIT
Latest version published 21 days ago

Package Health Score

94 / 100
Full package analysis