diff --git a/src/content/docs/en/guides/actions.mdx b/src/content/docs/en/guides/actions.mdx index 4a2fc1b1879c2..5445af3c5a86e 100644 --- a/src/content/docs/en/guides/actions.mdx +++ b/src/content/docs/en/guides/actions.mdx @@ -411,6 +411,8 @@ Calling [Astro.getActionResult()](/en/reference/api-reference/#getactionresult) To call an action from an HTML form, add `method="POST"` to your `
`, then set the form's `action` attribute using your action, for example `action={actions.logout}`. This will set the `action` attribute to use a query string that is handled by the server automatically. +Note: If your form includes file uploads, you must also add `enctype="multipart/form-data"` to the `` element. This ensures that files are sent in a format that allows Astro's schema validation library to correctly recognize `z.instanceof(File)` inputs. + For example, this Astro component calls the `logout` action when the button is clicked and reloads the current page: ```astro title="src/components/LogoutButton.astro"