For file upload, I have been using TempFile. However, I don't feel that it is very ergonomic. You have to store the file first to read it and later delete it.
Here is some pseudo code which showcase how sometimes I had to use it.
#[post("/upload", data = "<file>")]
async fn process_file(mut file: TempFile<'_>) -> std::io::Result<()> {
let uuid = Uuid::new_v4();
let random_file_name = format!("/tmp/{uuid}");
file.persist_to(&random_file_name).await?;
let content = fs::read(&random_file_name)?;
fs::delete(&random_file_name)?;
Ok(())
}
I did not find existing alternative in Rocket.