(
MultipartForm(form): MultipartForm<UploadForm>,
)
| 18 | } |
| 19 | |
| 20 | async fn save_files( |
| 21 | MultipartForm(form): MultipartForm<UploadForm>, |
| 22 | ) -> Result<impl Responder, Error> { |
| 23 | for f in form.files { |
| 24 | let path = format!("./tmp/{}", f.file_name.unwrap()); |
| 25 | log::info!("saving to {path}"); |
| 26 | f.file.persist(path).unwrap(); |
| 27 | } |
| 28 | |
| 29 | Ok(HttpResponse::Ok()) |
| 30 | } |
| 31 | |
| 32 | async fn index() -> HttpResponse { |
| 33 | let html = r#"<html> |
nothing calls this directly
no outgoing calls
no test coverage detected