downloading test

This commit is contained in:
SpikeHD
2022-05-09 19:34:50 -07:00
parent 045b3d3902
commit 0a2365e546
3 changed files with 58 additions and 6 deletions

View File

@@ -20,7 +20,7 @@ pub async fn download_file(window: tauri::Window, url: &str, path: &str) -> Resu
.or(Err(format!("Failed to get {}", url)))?;
let total_size = res
.content_length()
.ok_or(format!("Failed to get content length from '{}'", &url))?;
.unwrap_or(0);
// Create file path
let mut file = File::create(path).or(Err(format!("Failed to create file '{}'", path)))?;