-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Uploads support #848
Comments
Sorry! Discuss it here. |
Hello, |
With the current version, you can write it as follows: app.post('/upload', async (c) => {
const { image } = await c.req.parseBody()
if (image instanceof File) {
console.log(image.name) // show the file name
const buffer = await image.arrayBuffer()
// do something with the buffer
}
return c.text('Uploaded!')
}) Written in #664 (comment) |
@yusukebe Is there an example for hono client? |
You can upload files using the client.upload.$put({
form: {
image: field.files[0]
}
}) |
It works like a charm! Thanks. |
Shouldn't this be included in the documentation? |
@yusukebe do we need to create some sort of middleware like |
Hi.
It would be nice to make it easy to handle uploads.
References:
The text was updated successfully, but these errors were encountered: