im trying to define a upload file api just like on example.
{ path: '/upload', bodyParsers: { json: false, urlencoded: false, }, aliases: { // File upload from HTML form 'POST /photos': 'multipart:v1.file.save', }, busboyConfig: { limits: { files: 1, fileSize: 10000000, }, }, mappingPolicy: 'restrict', },
but when get ctx.param only got:
ctx.params { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: null, ended: false, endEmitted: false, .........
it lead me to error like TypeError: stream.on is not a function
I found some interface like FileStream interface is missing, i no idea why it happen.
If you upload a file, the ctx.params will contain a Node.js Stream instance. It works, you can find example code here and here. If you think you find an issue, please create a repro example on repl.it or codesandbox.
im trying to define a upload file api just like on example.
{ path: '/upload', bodyParsers: { json: false, urlencoded: false, }, aliases: { // File upload from HTML form 'POST /photos': 'multipart:v1.file.save', }, busboyConfig: { limits: { files: 1, fileSize: 10000000, }, }, mappingPolicy: 'restrict', },
but when get ctx.param only got:
ctx.params { _readableState: ReadableState { objectMode: false, highWaterMark: 16384, buffer: BufferList { head: null, tail: null, length: 0 }, length: 0, pipes: [], flowing: null, ended: false, endEmitted: false, .........
it lead me to error like TypeError: stream.on is not a functionI found some interface like FileStream interface is missing, i no idea why it happen.