koajs / examples

Example Koa apps
4.52k stars 744 forks source link

multipart/app.js - files is accessed directly from ctx.request as opposed to ctx.request.body #124

Open JaimeStill opened 6 years ago

JaimeStill commented 6 years ago

I know the version of koa used in the examples differs from the version I'm using following along with the examples (2.2.0 vs. 2.5.2), but wanted to raise a fundamental difference in the ctx object for extracting files from the request:

app.js in the examples has the following:

const files = ctx.request.body.files || {};

In version 2.5.2, this has to be set as follows:

const files = ctx.request.files || {};

Pretty sure it's a difference between versions, but figured I'd raise the issue in the event that someone else has troubles.

gustvao commented 4 years ago

@JaimeStill thank you! Koa Team, pls update DOCS

niftylettuce commented 4 years ago

PR welcome @gustvao