(&self, file: &TempFile, key_prefix: &str)
| 72 | } |
| 73 | |
| 74 | async fn upload(&self, file: &TempFile, key_prefix: &str) -> UploadedFile { |
| 75 | let filename = file.file_name.as_deref().expect("TODO"); |
| 76 | let key = format!("{key_prefix}{filename}"); |
| 77 | let s3_url = self |
| 78 | .put_object_from_file(file.file.path().to_str().unwrap(), &key) |
| 79 | .await; |
| 80 | UploadedFile::new(filename, key, s3_url) |
| 81 | } |
| 82 | |
| 83 | async fn put_object_from_file(&self, local_path: &str, key: &str) -> String { |
| 84 | let mut file = fs::File::open(local_path).await.unwrap(); |
no test coverage detected