Replies: 1 comment 1 reply
-
Not sure if this answers your question, but the docs have an example of a form with 2 fields It uses the schema to describe the shape of the data (both a public async store ({ request }: HttpContextContract) {
const userSchema = schema.create({
email: schema.string(),
avatar: schema.file({
size: '2mb',
extnames: ['jpg', 'png', 'jpeg'],
}),
})
const data = await request.validate({
schema: userSchema,
})
await data.avatar.move(Application.tmpPath('uploads'))
return 'File uploaded successfully'
} Does this solve for the use-case you're talking about here? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In Adonis 4, you used to be able to do the following:
However, this isn't available in v5. The documentation for v5 states that the body parser can handle multipart/form-data, yet this clearly isn't the case.
Does anyone know how to use the text FormData with file upload in Adonis 5?
Beta Was this translation helpful? Give feedback.
All reactions