change file options
This commit is contained in:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user