Ask questionsSupport multipart form data

Sorry! I am learning English. So... I mean this That's the request header: image That's the request body: image The type is multipart/form-data This my router:

export default router => {
  router.get('/getList', async ctx => {
    ctx.response.body = 'get getList';
  });'/getList', async ctx => {
    const result = await ctx.request.body({
      contentTypes: {
        json: ['application/json'],
        form: ['multipart/form-data'],
        text: ['application/json']
    if(result.type === 'form'){
    ctx.response.body = result.value;

But what I got is null, I consoled this value with for...of, the output is

Content-Disposition: form-data; name",


I know this is the boundary, but how to deal whit this file type? Thank you very much! : )


Answer questions kitsonk

I've started working on this, but it is fairly complex. I am not convinced the std multi part really is a good interface, so I am going to come up with something a better better I think.


Related questions

No questions were found.
Github User Rank List