salvo-file-handling
Installation
SKILL.md
Salvo File Handling
Setup
[dependencies]
salvo = { version = "0.94.0", features = ["size-limiter"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs"] }
req.file()/req.files() return Option<&FilePart> / Option<&Vec<FilePart>>. Salvo writes multipart parts to a temp dir, so file.path() points at an on-disk file — copy or rename it to the final location; don't rely on it sticking around after the handler returns.
Single File Upload
use std::path::Path;
use salvo::prelude::*;