Here's a simplified version of the code:
#[post("/upload",data="<file>")]
fn upload_handler(file: Data) -> Redirect {
let mut buffer = Vec::new();
file.stream_to(&mut buffer).unwrap();
println!("{}",String::from_utf8_lossy(&buffer));
Redirect::to("/")
}
But all i get when reading the buffer is:
--------------------------f8761027cd2bdc69
Content-Disposition: form-data; name="file"; filename="teste.txt"
Content-Type: text/plain
CONTENT HERE
--------------------------f8761027cd2bdc69--
I want to be able to get the content length of the file without downloading it