Skip to content

파일 업로드

multipart/form-data 콘텐츠 타입을 사용해 파일을 업로드할 수 있다. 업로드된 파일은 c.req.parseBody()에서 접근 가능하다.

ts
const app = new Hono()

app.post('/upload', async (c) => {
  const body = await c.req.parseBody()
  console.log(body['file']) // File | string
})

관련 자료

Released under the MIT License.