pub struct MultipartFormData<T = ()> { /* private fields */ }Expand description
A streaming multipart form data handler.
This type makes it easy to send and receive multipart form data in a streaming fashion by directly
leveraging the corresponding dioxus_html::FormData and axum::extract::Multipart types.
On the client, you can create a MultipartFormData instance by using .into() on a FormData instance.
This is typically done by using the FormEvent’s .data() method.
On the server, you can extract a MultipartFormData instance by using it as an extractor in your handler function.
This gives you access to axum’s Multipart extractor, which allows you to handle the various fields
and files in the multipart form data.
§Axum Usage
Extractor that parses multipart/form-data requests (commonly used with file uploads).
⚠️ Since extracting multipart form data from the request requires consuming the body, the
Multipart extractor must be last if there are multiple extractors in a handler.
See “the order of extractors”
§Large Files
For security reasons, by default, Multipart limits the request body size to 2MB.
See DefaultBodyLimit for how to configure this limit.