Core: Bug in request.multipart.field

Created on 29 Oct 2018  路  4Comments  路  Source: adonisjs/core

I'm trying to use the example i found in #851 , but seems broken.

The body var is still empty, and i have a lot of multipart fields in my request.

Anyone knows how to solve it?

/**
   * Create/save a new invoice.
   * POST invoices
   */
  async store ({ params, request, response, auth }) {
    var body = {}
    request.multipart.field((name, value) => {
      console.log(name)
      console.log(value)
      body[name] = value
    })

    console.log(request.body)
    console.log(body)
}

Most helpful comment

This is what you are missing

screenshot 2018-10-30 at 10 33 22 am

All 4 comments

This is what you are missing

screenshot 2018-10-30 at 10 33 22 am

How did you find about request.multipart.field() by yourself? it is not mentioned in the documentation @un-versed

I wonder why await request.multipart.process() works only POST but not in PATCH ?

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GianCastle picture GianCastle  路  3Comments

douglaszaltron picture douglaszaltron  路  3Comments

ghost picture ghost  路  3Comments

devcaststudio picture devcaststudio  路  3Comments

begueradj picture begueradj  路  3Comments