Hello!
I would like create a service for downloading files by web browser.
I don't know how to create an HTTP response from bytes (file, Vec<u8>
).
Please help me.
let app = Router::new()
.route("/download/*key", get(download))
.with_state(state);
pub async fn download(state: State<AppState>,
Path(path): Path<String>) -> impl IntoResponse
{
let f: Vec<u8> = state.file.unwrap();
/// TODO: create Response
}