Hi, would be possible to access headers for poem::web::Field?
Due to limited resources on the device, when handling large file uploads, we need to write the multipart file stream to disk rather than loading it entirely into RAM. Ideally, we would like to make this decision based on the Content-Length header to determine whether the file can be temporarily stored in RAM or should be written directly to disk. However, since headers are private, we are unable to access the Content-Length directly.
Thank you
Code example (if possible)
async fn parse_from_multipart(field: Option<poem::web::Field>) -> ParseResult<Self> {
match field {
Some(field) => {
let content_length = field.headers().get("Content-Length"); // or field.get_header(header::CONTENT_LENGTH)
// ... rest of code ...
}
_ => {
// Handle None case if necessary
}
}
}
Description of the feature
Hi, would be possible to access headers for poem::web::Field? Due to limited resources on the device, when handling large file uploads, we need to write the multipart file stream to disk rather than loading it entirely into RAM. Ideally, we would like to make this decision based on the Content-Length header to determine whether the file can be temporarily stored in RAM or should be written directly to disk. However, since headers are private, we are unable to access the Content-Length directly.
Thank you
Code example (if possible)