change file options

This commit is contained in:
Shawn Bloecker
2025-10-01 14:24:56 +02:00
parent f1cd09a218
commit e62b6ae0c3

View File

@@ -40,10 +40,9 @@ async fn upload(mut multipart: Multipart) -> Result<Html<String>, StatusCode> {
println!("Got file name: {file_name}");
let mut file = tokio::fs::OpenOptions::new()
.truncate(true)
.write(true)
.truncate(true)
.create(true)
.create_new(true)
.open(format!("./uploads/{file_name}"))
.await
.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?;